How to run a cron job automatically after a server reboot
This article demonstrates how to run a cron job automatically after a server reboot. For example, you may want to run a particular script file or application after a server restarts.
To do this, use the @reboot crontab directive in the cron job instead of a particular day or time. For example, the following cron job runs the start_application.sh script file in the user’s home directory one time only after the system restarts:
@reboot ${HOME}/start_application.sh
Remember to specify the full path to the file you want to run in the cron job. Alternatively, you can use Bash environment variables such as ${HOME} and ${USER} to help specify the path.