Linux Execute Cron Job After System Reboot
To execute a cron job after system reboot on Linux, you can add a cron job to the root crontab that runs at reboot.
Here are the steps to create a cron job to run after system reboot:
- Open the root crontab file for editing using your preferred text editor. You can use the following command to open the crontab file in the vi editor:
sudo crontab -e - Add the following line to the crontab file:
@reboot /path/to/your/scriptReplace
/path/to/your/scriptwith the path to your script that you want to run after system reboot. - Save the changes to the crontab file and exit the editor.
