Mailinglist Archive: opensuse (4547 mails)

< Previous Next >
Re: [SLE] Backing up /home...?
  • From: "Rob Freeman" <sysadmin@xxxxxxxxxxxx>
  • Date: Fri, 21 May 2004 09:15:30 -0500
  • Message-id: <024001c43f3e$12781b80$45a610ac@xxxxxxxxxxxx>

----- Original Message -----
From: "C Hamel" <vgm2@xxxxxxxxxx>
To: "SuSE" <suse-linux-e@xxxxxxxx>
Sent: Friday, May 21, 2004 9:01 AM
Subject: [SLE] Backing up /home...?

Hash: SHA1

I have a command sequence...
# cd /home
# tar cSpf - . | (cd /home2 ; tar xvSpf - )
...that puts all of /home in another place & simultaneously unTARs it. What
really need is a TAR command that stays tarred, but I have had real problems
debugging my command line! I would like to couple that (in a script) with
the command offered by Ken Schneider, I believe, to delete the older file
before creating the new one. HEEELLLP!! <G>

- --

Here is what I use, might not be pretty, but gets the job done:

searchdate=`date +'%b %e'`
cp -vf /data/Backup/home.tar.gz /data/Backup/home.tar.gz .`date
\+\%y\%m\%d` 2>&1 > /tmp/backup.log

# Make backup of home directory
tar cvzf /data/Backup/home.tar.gz /home >> /tmp/backup.log

# Check for any backups over 30 days old
find /data/Backup/home* -mtime +30 -exec ls {} \; >> /tmp/backup.log

# Delete any backups over 30 days old
find /data/Backup/home* -mtime +30 -exec rm {} \; >> /tmp/backup.log

# mail me the log
mail somewhere@xxxxxxxxxxxx -s "Backup Report for $searchdate" <

YMMV on the above


< Previous Next >
Follow Ups