LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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, 05: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, 06: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, 07: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, 08:07 AM   #4
choogendyk
Senior Member
 
Registered: Aug 2007
Location: Massachusetts, USA
Distribution: Solaris 9 & 10, Mac OS X, Ubuntu Server
Posts: 1,191

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, 09: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 02:59 PM
Question about backing up home directory IndyGunFreak Ubuntu 2 02-04-2007 02:19 AM
backing up a directory to another hard drive aducarrab Linux - Newbie 1 01-29-2005 10:27 PM
Backing up selected directory... CRCool75 Linux - Enterprise 26 07-23-2004 10:01 PM
backing up directory to CD-RW drive? jermo5 Linux - Software 2 08-06-2003 04:09 PM


All times are GMT -5. The time now is 02:28 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration