Results 1 to 2 of 2
Ive created this cron job:
Code:
# m h dom mon dow command
0 3 * * * /home/backup1/backupsite.sh # backup whole site
That executes this script daily:
Code:
#!/bin/bash
...
- 04-08-2009 #1Just Joined!
- Join Date
- Apr 2009
- Posts
- 1
Cron job script creating corrupt archive
Ive created this cron job:
That executes this script daily:Code:# m h dom mon dow command 0 3 * * * /home/backup1/backupsite.sh # backup whole site
This creates a corrupted archive everytime. When I run sudo ./backupsite.sh manually it runs just fine. What is the deal here?Code:#!/bin/bash # backupsite.sh tar -cjvf /mnt/disk3/site_backups/site_bkup_`date +\%F_\%H\%M`_auto.tar.bz2 /var/www/* --exclude="/var/www/backup" cp /mnt/disk3/site_backups/site_bkup_`date +\%F_\%H\%M`_auto.tar.bz2 /var/www/backup/db_backups chmod -R 755 /mnt/disk3/
- 04-08-2009 #2Just Joined!
- Join Date
- Sep 2007
- Location
- Lafayette, IN
- Posts
- 83
Can you post the output from a cron run and a manual run? I'm guessing the cron job runs under the same account you use when you run it manually. There's probably a difference in the environment we'll need to hunt down.


Reply With Quote