Cron is a tool for configuring scheduled tasks on Unix systems. It is used to schedule commands or scripts to run periodically and at fixed intervals. Tasks range from backing up the user’s home folders every day at midnight, to logging CPU information every hour.
This video will show you how to auto run Raspberry Pi script on start.
Run crontab with the -e flag to edit the cron table:
Select an Editor
The first time you run crontab you’ll be prompted to select an editor; if you are not sure which one to use, choose nano by pressing Enter.
Run a Task on Reboot
To run a command every time the Raspberry Pi starts up, write @reboot. For example:
@reboot python /home/pi/myscript.py
This will run your Python script every time the Raspberry Pi reboots. If you want your command to be run in the background while the Raspberry Pi continues starting up, add a space and & at the end of the line, like this:
@reboot python /home/pi/myscript.py &