/USR/SBIN/CRON[492]: (CRON) error (grandchild #493 failed with exit status 127)
When cron job exits with status 127, in fact it is the exit status of the shell.
http://tldp.org/LDP/abs/html/exitcodes.htmlAs seen below, 127 means "command not found". In my case, the cron line was faulty:
Code:
50 13 * * * root (cd /root/scripts/auto-mysql-backup/ && /root/scripts/auto-mysql-backup/automysqlbackup ) >/dev/null2>&1
The cron entry in /var/log/syslog was:
Code:
Apr 22 13:47:01 hammond /USR/SBIN/CRON[493]: (root) CMD (root cd /root/scripts/auto-mysql-backup/ && /root/scripts/auto-mysql-backup/automysqlbackup >/dev/null 2>&1)
Apr 22 13:47:01 hammond /USR/SBIN/CRON[492]: (CRON) error (grandchild #493 failed with exit status 127)
The problem is that /etc/crontab does not support "user command", just "command" (my memory is dumping).
Debugging is easy. Send the output and standard error to a file and look at that file when cron runs that job.
Correct crontab entry was:
Code:
50 13 * * * (cd /root/scripts/auto-mysql-backup/ && /root/scripts/auto-mysql-backup/automysqlbackup ) >/dev/null2>&1