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 am a Windows 7 user and looking for a sync tool that exactly copies the structure of the source to that of the destination.

The scenario is as follows:

  • I have a laptop in which I save my daily projects. I always bring this laptop wherever I go to work, either at my school or at my house.
  • At school I have a room in which I put an external hard drive to backup my laptop data. Upon arriving at school I always sync the external data with my laptop. Before leaving the school, I also do the synchronization if I make some modification in my laptop data.
  • I do the same thing when I arrive and leave my house.
  • Every month I reformat my laptop because of some trial softwares.

I am using SyncToy 2.1 to sync the external drives with my laptop. The problem is as follows.

Before formatting my laptop, I sync all external drives with my laptop. For example,

My laptop structure:

c:\data\file1.ext
c:\data\folder1\file2.ext

Both external drive structure:

d:\data\file1.ext
d:\data\folder1\file2.ext

After reformatting my laptop, I move the file1.ext to folder1. So my laptop structure becomes,

c:\data\folder1\file1.ext
c:\data\folder1\file2.ext

If I sync external drives with my laptop, I get

d:\data\file1.ext
d:\data\folder1\file1.ext
d:\data\folder1\file2.ext

I want the tool also remove d:\data\file1.ext. How to do this?

share|improve this question

closed as not constructive by Xavierjazz, 8088, Tom Wijsman, Sirex, Simon Sheehan Sep 27 '12 at 22:55

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.If this question can be reworded to fit the rules in the help center, please edit the question.

    
There is no magic tool that can look at all your files randomly and find duplicates, merge them to one structure, and then delete all but 1 duplicate. In the end, what you've described is not possible because you've deliberately "copied" files all around your filesystem and you want someone to clean up your mess for you. How would a program know what is a duplicate? and what is merely two documents with the same contents? It cannot read your mind. –  TheCompWiz Sep 27 '12 at 15:24
    
@TheCompWiz: It is possible when SyncToy provides a hidden file as a log on which both pairs are synced previously, so I can make use of this file again after re installing my laptop. –  stalking is prohibited Sep 27 '12 at 15:37

1 Answer 1

up vote 1 down vote accepted

The tool you are describing is "rsync".

It's something which started life on Unix but as with all useful tools has been ported to most operating systems now, including Windows.

Rsync offers a wide variety of options, including to remove files from the destination when they are no longer on the source, as in your example.

As for which version of rsync to use, I'm afraid I really can't advise, each has different strengths and weaknesses and I'd recommend you try them to see which best fits your preferences.

I can say that cygwin (Virtually all Unix tools ported to Windows) is very good, and worth a look.

share|improve this answer
    
Can rsync be used for local source and local destination as opposed to remote destination? –  stalking is prohibited Sep 27 '12 at 16:10
    
Yes it can. Just specify local paths for the two parameters –  Haqa Sep 27 '12 at 16:13
    
When I invoke rsync -a --delete -v --progress "/cygdrive/c/Examples/" "/cygdrive/f/Examples", I got the same structure in the destination but when opening each folder in the destination, I get a pop up window. What is wrong? –  stalking is prohibited Sep 27 '12 at 16:21
    
Rsync is fundamentally a Unix tool, it's not going to copy all the extended Windows permissions lists, so it's likely the files at the target are getting the permissions from the parent directory –  Haqa Sep 27 '12 at 16:27
    
Well done. I have to use --chmod=ugo=rwX option as well. –  stalking is prohibited Sep 27 '12 at 16:31

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