LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 02-14-2013, 02:53 PM   #1
leupi
Member
 
Registered: Mar 2004
Location: Annapolis, Maryland, USA
Distribution: Ubuntu 11.04, Mint 11.11, Xubuntu 11.11
Posts: 457

Rep: Reputation: 30
Using rsync to back up photo library


I currently have all of my photos on my laptop and every now and then I copy them over to a server that I have set up in my house. I delete the directory 'photos' on the server and then copy the directory 'photos' from my workstation over to the server. Not real efficient. Especially since my photo library is growing.

I know that rsync only copies the changes and not the entire directory so this seems ideal. How does that work with images? I might make a small modification to an image, perhaps just change the metadata. Will rsync have any issue with this? Is rsync even the best option for something like this?
 
Old 02-14-2013, 03:40 PM   #2
suicidaleggroll
Senior Member
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 2,749

Rep: Reputation: 977Reputation: 977Reputation: 977Reputation: 977Reputation: 977Reputation: 977Reputation: 977Reputation: 977
rsync would be a good choice for this. It can operate in two ways - only copying the changes in files, or re-copying the entire file if it's changed. You can always start with just copying the changes, and if you find that it's not working correctly you can modify the call to copy the entire file if it's been changed. Either way it will be much better than copying over all files all the time.
 
Old 02-14-2013, 04:06 PM   #3
leupi
Member
 
Registered: Mar 2004
Location: Annapolis, Maryland, USA
Distribution: Ubuntu 11.04, Mint 11.11, Xubuntu 11.11
Posts: 457

Original Poster
Rep: Reputation: 30
I ran the following:
Code:
rsync -av /home/name/Pictures/ shared/name/Pictures
But got a lot of chmod errors so I changed it to
Code:
rsync -rt /home/name/Pictures/ shared/name/Pictures
and that seemed to get rid of the errors and copy the files over. I then modified one image and ran the command again. It quickly went to a waiting command line and it looked like nothing had happened. I looked in the destination folder and it had indeed updated the file.

Should I be concerned about any other switches or is rt all that I should need? I assume that r is recursive and t maintains that timestamp.

Thanks
 
Old 02-14-2013, 04:13 PM   #4
suicidaleggroll
Senior Member
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 2,749

Rep: Reputation: 977Reputation: 977Reputation: 977Reputation: 977Reputation: 977Reputation: 977Reputation: 977Reputation: 977
Code:
man rsync
will define all of the switches

-a is an alias for -rlptgoD, and -v just means verbose

You already have -rt in your new command, so the ones you're missing are:
-l copy symlinks as symlinks
-p preserve permissions
-g preserve group
-o preserve owner
-D preserve device and special files

Assuming you have no symlinks, devices, or special files, the only things you'll be missing are the owner, group, and permission retention, which sounds like it's a problem anyway (probably due to the way the share is being mounted). So you're fine. If you want more verbosity you could add -v or --progress to the command as well.
 
Old 02-14-2013, 04:17 PM   #5
leupi
Member
 
Registered: Mar 2004
Location: Annapolis, Maryland, USA
Distribution: Ubuntu 11.04, Mint 11.11, Xubuntu 11.11
Posts: 457

Original Poster
Rep: Reputation: 30
That's great, -v is what I wanted, I should have known that. Thanks again for the help.
 
  


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 On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Getting Back To Where I Came From With a Photo Gallery petelogan Suse/Novell 2 12-17-2011 11:49 AM
back-up question many different sources (rsync) schneidz Linux - Newbie 2 03-07-2011 07:58 AM
Can rsync back up to multiple sites simultaneously? eperry77 Linux - Software 2 12-08-2009 10:26 AM
windows workstation back through rsync to linux server tsaravan Linux - Server 3 10-22-2007 04:08 AM
LXer: Back up like an expert with rsync LXer Syndicated Linux News 0 07-17-2007 03:46 PM


All times are GMT -5. The time now is 02:38 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration