I've got the following script, mysql_cron_bkup, to backup a database:
#!/bin/bash
date=`date +%d%m%y`;
filename="bugs$date.sql";
mysqldump -u bugs --password=bugs --opt bugs > /usr/local/mysql/backups/$filename;
crontab:
10 0 * * 6 cd /usr/local/mysql/backups; ./mysql_cron_bkup
When it runs in crontab, it creates a file with a size of 0 bytes. However, when I execute it at the command-line or with 'at', it works fine. Its permissions are 755.
Can anyone help? ------------------------------------------------------------------
It's important to think. It's what separates us from lentils.
#!/bin/bash
date=`date +%d%m%y`;
filename="bugs$date.sql";
mysqldump -u bugs --password=bugs --opt bugs > /usr/local/mysql/backups/$filename;
crontab:
10 0 * * 6 cd /usr/local/mysql/backups; ./mysql_cron_bkup
When it runs in crontab, it creates a file with a size of 0 bytes. However, when I execute it at the command-line or with 'at', it works fine. Its permissions are 755.
Can anyone help? ------------------------------------------------------------------
It's important to think. It's what separates us from lentils.