PDA

View Full Version : [ubuntu] Folder Sync Software?



csharpplus
October 10th, 2010, 11:33 PM
I a newbie, so thanks in advance for any help.

I have a folder (let's call it folderA) that have its contents changed every day. I would like to keep an exact copy of the contents that are in folderA in a different folder (let's call it folderB).

What is the simplest program (running from the command line) that will achieve this?

Note: folderA can change by either of the following:
(i) new files are added to it.
(ii) existing files are deleted from it.

folderB will have to reflect these changes (so new files must be added to it; and old files -- that were removed from folderA -- must be removed also from it). thanks for helping!

mikewhatever
October 10th, 2010, 11:42 PM
Rsync.


rsync -av /folderA/ /folderB/

Dex73
October 10th, 2010, 11:57 PM
Rsync.


rsync -av /folderA/ /folderB/

You beat me to the answer. Although, if you would like to save the command for frequent use, (so it will just be there) luckybackup uses gui and has rsync as it's backend. I'm not sure if the command line would offer this.

csharpplus
October 10th, 2010, 11:59 PM
that you both!

Would rsync know to delete from folderB files that are no longer in folderA?

Also, can I define that 'copying' must be done only from folderA tofolderB (meaning, folderA 'determines' how folderB would look like -- not vice versa)?

mikewhatever
October 11th, 2010, 12:39 AM
To delete the files, use the --delete switch:

rsync -av --delete /source /destination

Look at 'man rsync' for more options.

csharpplus
October 11th, 2010, 01:03 AM
great, thank you!