gzip archives coming up invalid!

From: Chris W. Parker (cparker_at_swatgear.com)
Date: 01/06/05

  • Next message: SW: "Setup syslog for firewall log message {Scanned}"
    Date: Thu, 6 Jan 2005 12:32:56 -0800
    To: "General Red Hat Linux discussion list" <redhat-list@redhat.com>
    
    

    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.

    -- 
    redhat-list mailing list
    unsubscribe mailto:redhat-list-request@redhat.com?subject=unsubscribe
    https://www.redhat.com/mailman/listinfo/redhat-list
    

  • Next message: SW: "Setup syslog for firewall log message {Scanned}"

    Relevant Pages

    • Re: [opensuse] downloading 10.3
      ... 32 bit x86 DVD but the iso file seems to be corrupt. ... Here is that script, note that this is all one line and the secondary ... script in the same directory as the download destination. ...
      (SuSE)
    • RE: Deleting FIles
      ... parameter on the DEL command - this should delete a hidden file ... When the script runs, who is it running as (the current user, ... The computername part of the code is ... I think that it actually runs as the SYSTEM account, ...
      (microsoft.public.windows.server.scripting)
    • Re: [opensuse] downloading 10.3
      ... 32 bit x86 DVD but the iso file seems to be corrupt. ... and the second had the proper md5sums. ... KDE on 10.2 snarfing the wget process while "killing" my login when my ... Here is that script, note that this is all one line and the secondary ...
      (SuSE)
    • Re: Corrupted IE
      ... > Program Files on my hard drive, it says it is 'Internet ... Check the box to Disable script debugging. ... Uncheck the box to Display a notification about every script error. ... Sometimes there's a corrupt file in the cache and one must go to Tools | ...
      (microsoft.public.windows.inetexplorer.ie6.browser)
    • Re: How do I clear out files within a directory? Help with script automation...
      ... The script that works!!! ... del *.* /Q ... > a batch file to be run at logon, that will clear out the entire contents ... > Best Regards, ...
      (microsoft.public.windows.file_system)