[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

gzip archives coming up invalid!



Hello,

I've been running a script in /etc/cron.daily that tar's the /etc,
/home, and /var directories and then gzip's them. After the gzip they
are FTP'd to a backup server.

I've just had the need to retrieve a file in one of the backups and it
turns out they are all corrupt! This is not good. :(

[root hachiroku ~/temp]# gzip -t 01-01-05.home.tar.gz

gzip: 01-01-05.home.tar.gz: invalid compressed data--format violated
[root hachiroku ~/temp]#

This is the script I am using, maybe there is a problem with it?? Or
maybe the corruption is happening during the FTP transfer?

=-=-=-=-=-=-=
#!/bin/bash

# set variables
DATE=`date +%m-%d-%y`
OLDDATE=`date +%m-%d-%y --date '7 days ago'`

# make sure we are executing the following commands from the correct
directory
cd /

# make the /var archive
tar -cW --totals --label $DATE.var -f $DATE.var.tar /var
gzip -9 -S .gz $DATE.var.tar

# make the /etc archive
tar -cW --totals --label $DATE.etc -f $DATE.etc.tar /etc
gzip -9 -S .gz $DATE.etc.tar

# make the /home archive
tar -cW --totals --label $DATE.home -f $DATE.home.tar /home
gzip -9 -S .gz $DATE.home.tar

echo "*** connecting to ftp and uploading files"

ftp -n ati-nas-01.ati.local > /var/log/lastbackup << endend
user user password
cd /linuxbackup/hachiroku
pwd
bell
del $OLDDATE.var.tar.gz
del $OLDDATE.etc.tar.gz
del $OLDDATE.home.tar.gz
put $DATE.var.tar.gz
put $DATE.etc.tar.gz
put $DATE.home.tar.gz
ls
quit
endend

#echo "***   Removing Backup Files"
rm -f $DATE.*tar.gz

#echo "*** Done"
exit 0
=-=-=-=-=-=-=-=-=


Any ideas would be appreciated!

The average size of the compressed /var file is ~68MB. /etc is ~1.5MB.
/home is ~50MB.


Thanks,
Chris.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]