bash backup
I need a fresh set of eyes. it's got to be simple but im missing it.
here is the script I'm using
#!/bin/bash
today=$(date '+%d_%m_%y')
echo "* Performing domain backup..."
tar czf /home/data/backup/example.com_"$today".tar.gz -C / home/domains/example.com/
# Remove backups older than 7 days:
MaxFileAge=7
find /home/data/backup/ -name '*.gz' -type f -mtime +$MaxFileAge -exec rm -f {} \;
echo "* Backed up..."
Here is what I get from the term
* Performing domain backup...
tar: home/domains/example.com/: Cannot stat: Permission denied
tar: /home/data/backup/example.com_11_11_09.tar.gz: Cannot open: Permission denied
tar: Error is not recoverable: exiting now
tar: Child returned status 2
tar: Error exit delayed from previous errors
find: /home/data/backup/: Permission denied
Permissions on the /home/data/backup are chmod 777
for security i altered the paths here. but are correct
do I have to change the permissions on my domain?
Last edited by kb2tfa; 11-11-2009 at 09:27 PM.
|