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 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 one time only after the system restarts:
Remember to specify the full path to the file you want to run in the cron job.
For more information about the @reboot directive and other directives you can use in cron jobs, type the following command at the command prompt:
man 5 crontab
- Cron jobs
You can use cPanel to configure cron jobs so commands run at user-defined intervals.
- Disabling e-mail notifications from cron jobs
By default, cron sends e-mail notifications when it runs a cron job. This article shows how to disable this behavior.
- Cron jobs reset to 15-minute intervals
This article only applies to shared hosting and reseller accounts. For server performance and stability reasons, cron jobs with intervals less than 15 minutes are reset to 15-minute intervals automatically.