PDA

View Full Version : [ubuntu] What is Wrong with my crontab commands?



legolas_w
July 6th, 2008, 08:39 AM
Hi
Thank you for reading my post
Can some one please let me know what is the problem that my computer does not shutdown in the given time? I tried to use cron jobs to schedule a shutdown but it looks like that it does not works.

when i execute
crontab -l i see the following:





00 07 * * * /sbin/shutdown -P now


I think this command tells the cron job to shutdown the computer at 7 AM?

What is wrong with the command?


thanks

sdennie
July 6th, 2008, 08:45 AM
If you are running "crontab -l" from your user directory, it means that you've set a cron job for that user. The only user that has permission to shutdown the machine is root so, your command is essentially ignored if it's coming from your user crontab. Try adding your command using:



sudo crontab -e