Search code examples
unixcroncentos

CentOS crontab job is not executing


I am trying to set up a crontab job to back up a mysql DB every day at a specific time. I do the following steps (as root):

  1. crontab -e
  2. 00 11 * * * root /root/my_Backups/productionbDB-backup.sh >> mybackup.log 2>&1
  3. service crond restart

I waited to be 11 am, but nothing happened. I confirmed that if the command /root/my_Backups/productionbDB-backup.sh is issued from the command line, as root, it creates the backup.

What am I missing?


Solution

  • 00 11 * * * root /root/my_Backups/productionbDB-backup.sh >> mybackup.log 2>&1 -> what is the root word doing there? What you should have is 00 11 * * * /root/my_Backups/productionbDB-backup.sh >> mybackup.log 2>&1