LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-11-2011, 04:23 AM   #1
che123
LQ Newbie
 
Registered: Aug 2011
Location: AUSTRIA
Posts: 10

Rep: Reputation: Disabled
backing up a directory


hi,

i have a stupid question about backing up a directory...
so i'm not sure if all sym links are preserved - actually are restored correctly.

is it sufficient to use tar like

tar czvf /mnt/backup/tools.tar.gz /mnt/lfs/tools/

or is it better to use rsync (what i have'nt ever used before) like

rsync -azvr /mnt/lfs/tools /mnt/backup/

friendly regards,
christian
 
Old 08-11-2011, 05:28 AM   #2
Andrew Benton
Senior Member
 
Registered: Aug 2003
Location: Birkenhead/Britain
Distribution: Linux From Scratch
Posts: 2,073

Rep: Reputation: 64
Tar will work fine. Try it for yourself to see. Personally I would cd /mnt/lfs first and use a slightly different set of options but each to their own.
Code:
cd /mnt/lfs
tar pfacS /mnt/backup/tools.tar.gz tools
 
1 members found this post helpful.
Old 08-11-2011, 06:03 AM   #3
che123
LQ Newbie
 
Registered: Aug 2011
Location: AUSTRIA
Posts: 10

Original Poster
Rep: Reputation: Disabled
Thank you, I'll give it a try!
 
Old 08-11-2011, 07:07 AM   #4
choogendyk
Senior Member
 
Registered: Aug 2007
Location: Massachusetts, USA
Distribution: Solaris 9 & 10, Mac OS X, Ubuntu Server
Posts: 1,197

Rep: Reputation: 105Reputation: 105
The tar is fine.

If you were going to do rsync, what I typically use is

Code:
rsync -aH --stats /mnt/lfs/tools/ /mnt/backup/tools
The use of the "/" at the end of the source and not at the end of the destination is important. I use the "--stats" rather than the "-v", because verbose can spew out way to much stuff if you have a lot being copied. I'm not sure why the "-r" would be needed, since the command I use descends into all the subdirectories.
 
1 members found this post helpful.
Old 08-11-2011, 08:37 AM   #5
che123
LQ Newbie
 
Registered: Aug 2011
Location: AUSTRIA
Posts: 10

Original Poster
Rep: Reputation: Disabled
OK, thank you both for the support!

@choogendyk: maybe the -r corresponds to the trailing '/'? just an assumption...
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Backing up home directory Steve W Linux - Newbie 19 08-25-2008 01:59 PM
Question about backing up home directory IndyGunFreak Ubuntu 2 02-04-2007 01:19 AM
backing up a directory to another hard drive aducarrab Linux - Newbie 1 01-29-2005 09:27 PM
Backing up selected directory... CRCool75 Linux - Enterprise 26 07-23-2004 09:01 PM
backing up directory to CD-RW drive? jermo5 Linux - Software 2 08-06-2003 03:09 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:56 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration