Page 1 of 1

crontab

Posted: Thu Oct 11, 2012 3:48 pm
by ferdi
how to reboot the system using crontab
I modified /etc/crontab so, but it doesn't work
30 17 * * * sudo reboot

Re: crontab

Posted: Thu Oct 11, 2012 3:58 pm
by thogue
Suggestion,

Log into root ( sudo -i )

Edit crontab for root with crontab -e, you can remove the sudo.

One thin with crons is make sure NTP is running and working. I've lost some crons due to time issues before.

Re: crontab

Posted: Thu Oct 11, 2012 4:06 pm
by RaTTuS
sudo crontab -e
30 17 * * * /sbin/shutdown -r now

will do it..

you don't want sudo in your crontabs as it will ask for a password and fail because there will be no keyboard to attach to the process