LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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 12-03-2010, 08:34 PM   #1
timl
Member
 
Registered: Jan 2009
Location: Sydney, Australia
Distribution: Fedora,CentOS
Posts: 750

Rep: Reputation: 156Reputation: 156
rsync question


Hi, I run 3 systems with various flavours of Fedora. I have recently bought a USB HDD to back up my files. The idea is I will push the files across every week or so.

What I would like to do is take a bunch of files and only copy those which are not already in the storage area.

I am sure there must be a switch in rysnc which avoids duplicates but it is not leaping out at me. Can anyone help?
 
Old 12-03-2010, 09:02 PM   #2
AlucardZero
Senior Member
 
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,824

Rep: Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615
rsync does that by default.
 
Old 12-04-2010, 01:48 AM   #3
gd2shoe
Member
 
Registered: Jun 2004
Location: Northern CA
Distribution: Debian
Posts: 835

Rep: Reputation: 49
AlucardZero is right. The whole point of rsync is that it is efficient (on the network). It transfers no more than it must. If a file doesn't change, it doesn't update it. If a file does change, it only transfers the difference.

You might ask other questions, such as "What should be done when you delete a file from the source directory?" Do you want it deleted at the other end (--delete) or left alone?

Keep the man page handy. Rsync can be fun to use, but it has many options. Test your setup before you trust it.
 
Old 12-04-2010, 02:40 AM   #4
b0uncer
LQ Guru
 
Registered: Aug 2003
Distribution: CentOS, OS X
Posts: 5,131

Rep: Reputation: Disabled
Read carefully the rsync options, from

Code:
man rsync
It explains it all in a lot of detail, so if you can't find something, check that you're not lazy on reading yes, it can be confusing too, but please do read it first, and when you don't understand some option(s), post them and ask. If you're interested in taking incremental backups on the same media, without losing space for non-changed files, check out the --link-dest=DIR option. Hard links don't cost you lots of space like "real" copies do, but allow you to get, for example, a directory hierarchy by date and time that allows for viewing "complete backups by time" instead of just a bunch of files that are "the newest". Sort of what OS X's Time Machine does.

When your rsync stuff is ready, test it and pay close attention to the results, to make sure it really does not re-transfer unchanged files. For example without the -u (--update) option rsync would copy files again and again even if they didn't change, but with it (after the first copy, if the original file does not change) the original file is older than the newer (which is created at the copy process), and causes rsync not to copy it until it changes (and thus becomes newer).
 
Old 12-04-2010, 03:27 AM   #5
gd2shoe
Member
 
Registered: Jun 2004
Location: Northern CA
Distribution: Debian
Posts: 835

Rep: Reputation: 49
Hard links will only work on a filesystem that supports them. You may need to reformat your drive if you want to take advantage of that advice.

b0uncer, either I'm not following what you're doing, or you've only described half of a very, very cool setup. Are you using the -b option somehow?
 
  


Reply



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
rsync question mokku Linux - Newbie 1 05-31-2008 08:56 AM
rsync question mahmoud Linux - Software 5 04-25-2008 05:13 AM
rsync question hepburnenthorpe Linux - General 1 11-19-2006 05:19 PM
rsync question juanb Linux - General 10 01-28-2006 03:18 PM
rsync question kpachopoulos Linux - General 3 07-15-2005 03:33 PM

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

All times are GMT -5. The time now is 06:10 PM.

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