Find the answer to your Linux question:
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 ...
  1. #1
    Just Joined!
    Join Date
    Apr 2009
    Posts
    1

    Cron job script creating corrupt archive

    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
    
    # 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/
    This creates a corrupted archive everytime. When I run sudo ./backupsite.sh manually it runs just fine. What is the deal here?

  2. #2
    Just 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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...