Crontab

Why is my crontab not rebooting the environment:
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
# For details see man 4 crontabs
# Example of job definition:
# .---------------- minute (0 - 59)
# | .------------- hour (0 - 23)
# | | .---------- day of month (1 - 31)
# | | | .------- month (1 - 12) OR jan,feb,mar,apr ...
# | | | | .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat
# | | | | |
# * * * * * user-name command to be executed
45 16 19 12 wed root reboot




  • post-author-pic
    James M
    12-20-2018

    Tim,


    Can you look for a related log messge and respond with what you find?  These will typically be in /var/log/syslog, /var/log/cron or /var/log/messages depending on your distribution.

  • post-author-pic
    Lethargos A
    12-20-2018

    What are you actually running there? I'm not sure why it says "user-name". I've never seen that in crontab. Crontab is going to run with the user you're currently using when executing crontab -e. So "root" would mean that you're running the command "root" (which doesn't exist) to which you're attaching the argument "reboot", which doesn't make sennse. Try to delete "root" and write "reboot" or "/usr/bin/reboot" or whatever path your distro is using for reboot.

Looking For Team Training?

Learn More