for a five thirty pm shutdown, should I change this:
30 02 * * * /sbin/shutdown -h now
to:
30 17 * * * /sbin/shutdown -h now
see also:
for a five thirty pm shutdown, should I change this:
30 02 * * * /sbin/shutdown -h now
to:
30 17 * * * /sbin/shutdown -h now
see also:
Yes, that's correct. Note that only root can run the shutdown command by default. So, if you have not done any tweaking with the permission of running the command just put the cron entry in the root user's cron (sudo crontab -e
) or add the entry in /etc/crontab
mentioning the user as root.
EDIT (Regarding Anacron): Absolutely bad idea. generally anacron is used while you want to run a command daily but you are not sure whether your computer will be On or Off. So lets say you have added an anacron entry to run a command. Then if the computer is On anacron checks and runs the command, if the computer was Off on that specified time the instant you turn On the computer next time anacron will run that command.
So, in a nutshell anacron is used while you are not sure your computer is gonna be On or Off. In your case you are shutting down the computer so if you put that to run by anacron your computer will be shut down by anacron if it was off and when you will turn it On after the specified time.
Your command
30 7 * * * root start -q anacron || : 30 17 * * * root /sbin/shutdown -h now
means that run 30 7 * * * root start -q anacron
first, if that fails run 30 17 * * * root /sbin/shutdown -h now
makes no sense i think. Just add the entry in crontab and that'll do the job.