Cron @reboot

Latest response

Hi,
I read an article that suggest using a special string @reboot on a user cron file. This can be used to execute a script at startup after a reboot command has been issued.
Does anyone know if this @reboot only works if the system is restarted by executing the reboot command, or will it still work if the system reboots but reboot command not executed, such as a system crash/reboot?

http://www.cyberciti.biz/faq/linux-execute-cron-job-after-system-reboot/

Responses

Just tested this in a VM because the man page is a bit vague.

I pulled the power (ie. dirty shutdown) and the script ran fine on boot.

That's a good test and thanks for trying.
I am working from home today, so cannot perform any tests as you have done.
My script worked fine with a reboot command, but did not start cleanly after a forcefull reboot with: echo 'b' > /proc/sysrq-trigger

Perhaps it is my script, I will have to look at it.
Once again, thanks.

Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.