How do I get Cron Jobs to run in 11.0

I have recently reinstalled 11.0 and started Cron, created a crontab file

crontab -e

and set up job

30 22 * * * root shutdown -r now

This does not work can anyone tell me why please


What account have you used to create the crontab file?

If you are using a regular account (not root), you will have to add that name in /var/spool/cron/allow in order for that to work.

Usually, both files, /var/spool/cron/allow and /var/spool/cron/deny don´t exist, which means that nobody will be able to schedule cron scripts appart from root.

Finally, double check what was the output of the last scheduled run of the script by taking a look at the files in the directory /var/spool/cron/lastrun/


30 22 * * * root shutdown -r now

This form of specification that you used cannot be used in personal crontabs, those that are edited with crontab -e, even if you are root. For personal crontabs, the sixth field is the command. So your cron job was trying to run the command “root”, which doesn’t exist.

Instead, use

30 22 * * * /sbin/shutdown -r now

Notice I have specified the absolute path to shutdown to eliminate problems with $PATH.

Also, as shutdown is a privileged command, it will only work if this is in root’s crontab.