ferdi
Posts: 45
Joined: Mon Jul 30, 2012 4:10 pm

crontab

Thu Oct 11, 2012 3:48 pm

how to reboot the system using crontab
I modified /etc/crontab so, but it doesn't work
30 17 * * * sudo reboot

thogue
Posts: 131
Joined: Wed Sep 19, 2012 2:16 am

Re: crontab

Thu Oct 11, 2012 3:58 pm

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.

User avatar
RaTTuS
Posts: 10559
Joined: Tue Nov 29, 2011 11:12 am
Location: North West UK
Contact: Twitter YouTube

Re: crontab

Thu Oct 11, 2012 4:06 pm

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
How To ask Questions :- http://www.catb.org/esr/faqs/smart-questions.html
WARNING - some parts of this post may be erroneous YMMV

1QC43qbL5FySu2Pi51vGqKqxy3UiJgukSX
Covfefe

Return to “Beginners”