How to schedule a cron after System Reboot in Linux


Many times we require to schedule cron job after the system start, in that scenario, we can use the below option to schedule any type of cron.



[himanshu@oel7 tmp]$ crontab -l
@reboot echo "this is running after system start `date`" >/tmp/bootcron.log



If we want to run after 2 mins of reboot then we can do as below. 120 value is the number of seconds to wait for

[himanshu@oel7 tmp]$ crontab -l
@reboot sleep 120 && echo "this is running after system start `date`" >/tmp/bootcron.log




If you like please follow and comment