Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have yearly backups of all my files on the harddrive.

The problem is that the Backup from 2007 contains files which don't exist in 2008. And I need both Versions of the Files, when they are different. So I can't overwrite the old version of the file with the new one.

I need a program which merges two folder structures. When the File from source and destination has the same content(Checksum or so) don't copy it. When the content is different copy it with Filename(1) for example.

Can anybody please give me a hint?

Thank You!

share|improve this question
    
which operating system are you using? –  l1zard Dec 8 '12 at 13:00
    
I'm using Windows 7 and Ubuntu 12.04 –  John Smithv1 Dec 8 '12 at 13:31
    
this problem can easily be solved with rsync using the -b option. –  l1zard Dec 8 '12 at 13:32
    
from man rsync:-b, --backup -b With this option, preexisting destination files are renamed as each file is transferred or deleted. You can control where the backup file goes and what (if any) suffix gets appended using the --backup-dir and --suffix options. –  l1zard Dec 8 '12 at 14:23

3 Answers 3

up vote 1 down vote accepted

(1) For Linux you can use rsync. If not already installed you should download and install rsync by doing:

sudo apt-get install rsync

or

sudo aptitude install rsync

from a command line.

supose you having the diretories 2007 and 2008 in the same subdirectory you could use rsync like this for example from within that particular directory

rsync -rtpogv -clis -b --suffix=new 2007/ 2008/

This would rename those files in the 2008 directory which are not in 2007 or have an older version in the 2007 directory to file.new

However before you are doing this you could use rsync with the -n option like this

rsync -rtpogv -clis -b --suffix=new -n 2007/ 2008/ &> rsync.log

and inspect the logfile to see if everything went the way you wanted it to.

(2) If you are on windows there is a tool called toucan which looks promissing to me. but i didn't try this one yet. http://portableapps.com/de/apps/utilities/toucan

share|improve this answer

You could try using WinMerge, if you want a GUI tool: http://winmerge.org/

share|improve this answer
    
nice one. didn't know this before. how does it handle nontext files? –  l1zard Dec 8 '12 at 15:20
    
Not much support for binary files, beyond checking whether they are identical or not –  William Saunders Dec 8 '12 at 15:50

I would highly recommend the Unison File Synchronizer, for several reasons:

  • Cross platform, open source
  • You can synchronize over a local filesystem (e.g. folder to folder), over TCP (i.e. from computer to computer), or over SSH
  • You can synchronize between different platforms (I use this to synchronize my files between my desktop and laptop)

Once you set up a synchronization profile, Unison detects what files were changed in what folder, and then provides you with an interactive interface to determine what files are to be transferred where. By default, the most recently modified files are set to overwrite the older ones. Unison also uses a checksum-style method to determine if files were modified, or to detect duplicates.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.