Cron job inside jail

Hi,

I have a problem with cronjob not executing bash script. It's a script that backups all my databases, sends them to mail and uploads them to ftp server. If i run script mannualy it works without any errors, I get mail, file is uploaded to ftp...
MySQL server is inside jail. Well nothing gets executed from cron inside jail. Not even simple echo like
Code:
*/1  *    *    *    *    root    echo "Test" | mail -s "Test!" "scv@domain.com"

Cron is running
Code:
projekti# ps -A | grep cron
 8939  ??  IsJ    0:00.00 /usr/sbin/cron -s
 9122  p0  R+J    0:00.00 grep cron

For testing purposes I put it to execute every minute
Code:
*/1     *       *       *       *       backup  /home/backup/scripts/mysql.sh

Logs:
Code:
May 25 09:12:01 projekti /usr/sbin/cron[9055]: (backup) CMD (/home/backup/scripts/mysql.sh)
May 25 09:13:01 projekti /usr/sbin/cron[9077]: (backup) CMD (/home/backup/scripts/mysql.sh)
May 25 09:14:02 projekti /usr/sbin/cron[9109]: (backup) CMD (/home/backup/scripts/mysql.sh)
May 25 09:15:01 projekti /usr/sbin/cron[9142]: (backup) CMD (/home/backup/scripts/mysql.sh)


Any ideas?
 
As SirDice says your syntax is wrong. Unless you use the system crontab (/etc/crontab) the username field should not be specified.

In general, as any output from cron is mailed to root it's usually quite easy to debug crontab problems by checking root's mail (or your own mail if you've done "the right thing" and aliased root to your regular user).
 
Back
Top