Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Server Replication (again) 1

Status
Not open for further replies.

m1bzm

ISP
Mar 6, 2001
31
0
0
GB
Hi all,

I read a few threads on this subject a few weeks ago. Can anyone answer this one for me?

Im would like to use this tar commmand:

tar -cplzf backup.tar.gz . --exclude backup.tar.gz

to backup my box but am I correct in understanding that it will only backup the "/" partition and not the "/boot" "/home" etc.

Thank you for your help. :)

Darren
 
Hi Krischrist

LOL your one step ahead of me because that was going to be my next question...

Im trying to work out how to backup the individual partitions to a file. Ive tried backing up the whole server to a file but the file size gets too big and the tar command fails :-(

Ill set up the scheduling as soon as I can work out the correct commands.

Thanks for your help..

Darren
 
tar -cplzf backup.tar.gz . --exclude backup.tar.gz

the "l" tells tar to stay in one filesystem only. it also stops tar from trying to tar up things you don't want, like /proc and /mnt.
you could do
tar -czf backup.tar.gz / --exclude "/proc/*" --exclude "/mnt/*"
to get it to cover all filesystems while still missing out stuff you don't want. the quotes "" are important in this case.

if you are tar'ing straight to tape then consider taking out the "z" for zip and find out if your tape drive does hardware compression since it will be better/faster.

this command also creates the tarball in "/" which might not be a good idea. it looks like an example i wrote so sorry if i misled. the "p" may not be needed either (i can never remember, it doesn't hurt tho ;) but if you restore the backup make sure the "p" is there as it keeps all the file permissions.
 
Hey thanks all - Ive got it going with all your help :)

This is part of the cron job and at the moment it works great. It takes a gziped tarball of all the important files and ftps them offsite.

====autobackup and ftp off site script===
tar -cplzvf /root.tar.gz . --exclude root.tar.gz
ftp -v -n ftp.server.com << SCRIPT
user USERNAME PASSWORD
put /root.tar.gz /home/backup/root.tar.gz
quit
SCRIPT
rm /root.tar.gz
tar -cplzvf /boot/boot.tar.gz /boot --exclude boot.tar.gz
ftp -v -n ftp.server.com << SCRIPT
user USERNAME PASSWORD
put /boot/boot.tar.gz /home/backup/boot.tar.gz
quit
SCRIPT
rm /boot/boot.tar.gz
etc....
=========================================

Thanks MrTom!

Darren
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top