[thelist] Linux Tar Question

CDitty mail at redhotsweeps.com
Wed Jan 10 03:33:26 CST 2001

Thanks to everyone that helped on this.  None of the suggestions 
worked.  Turns out I had to delete the directory and recreate it.   My 
support people were stumped on this one to.  After a few minutes of trying 
things, we agreed on the delete and recreate.  Luckily, there was nothing 
important in the directory.  :)

Now, what I was using this information for.  Since I am on a dedicated 
server and trying to cut costs, I needed a backup process that I could do 
quickly and was free.  I went and hacked an already existing mysql backup 
script and made it work for me.  Here it is for the world to use.   I am 
not the original creator, just the hacker.  :)  I accept no responsibility, 
but I will accept praise.  :)


#! /bin/sh

# Backup the entire web directory with
# the exception of the stats directory
# Suggested use - Cron once per day
# This will give you a 2 week backup.
# If you want more or less, simply
# add or delete the mv lines to fit.
# Enjoy

# Variables
/bin/tar --exclude=site_backups -cf $datadir$filename $datadir

cd $datadir
mv $archivedir$filename.14.gz $archivedir$filename.15.gz
mv $archivedir$filename.13.gz $archivedir$filename.14.gz
mv $archivedir$filename.12.gz $archivedir$filename.13.gz
mv $archivedir$filename.11.gz $archivedir$filename.12.gz
mv $archivedir$filename.10.gz $archivedir$filename.11.gz
mv $archivedir$filename.9.gz $archivedir$filename.10.gz
mv $archivedir$filename.8.gz $archivedir$filename.9.gz
mv $archivedir$filename.7.gz $archivedir$filename.8.gz
mv $archivedir$filename.6.gz $archivedir$filename.7.gz
mv $archivedir$filename.5.gz $archivedir$filename.6.gz
mv $archivedir$filename.4.gz $archivedir$filename.5.gz
mv $archivedir$filename.3.gz $archivedir$filename.4.gz
mv $archivedir$filename.2.gz $archivedir$filename.3.gz
mv $archivedir$filename.1.gz $archivedir$filename.2.gz
mv $archivedir$filename.0.gz $archivedir$filename.1.gz
mv $filename $archivedir$filename.0

/usr/bin/gzip $archivedir$filename.0

More information about the thelist mailing list