Hello Everyone,
My script fails in cron but runs OK manually, here is what I have done.
Created a very simple script :
Added to crontab using
Tested at shell prompt by executing :
and get a successful backup of database and public_html directory.
When cron runs both files date and time updates, so I know it ran! However, the SQL file size is ZERO! It should be in excess of 9Mb, the TAR file is as it should be just under 500Gb.
Any idea why crontab fails to grab a good MySQL dump would be appreciated.
Kulraj
My script fails in cron but runs OK manually, here is what I have done.
Created a very simple script :
Code:
#!/bin/sh
mysqldump -u User -pPassword dbname > /usr/home/username/backups/dbname.sql
tar -czf /usr/home/username/backups/dailybackup.tar.gz /usr/home/username/public_html/
crontab -e
as root :
Code:
1 3 * * * /usr/local/bin/bash /usr/local/etc/backup/bkup.sh
# /usr/local/bin/bash /usr/local/etc/backup/bkup.sh
and get a successful backup of database and public_html directory.
When cron runs both files date and time updates, so I know it ran! However, the SQL file size is ZERO! It should be in excess of 9Mb, the TAR file is as it should be just under 500Gb.
Any idea why crontab fails to grab a good MySQL dump would be appreciated.
Kulraj