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.

This may seem like a simple request at first glance, but I believe it is not due to some critical subtleties I wish to keep track of. Here is the scenario:

I have a directory on my home workstation, that I have cloned to a portable 1TB HD to have with me on business trips, for use with my laptop. This means that I make changes to the home copy, and the mobile copy, at different times. This may include not only altering files, but creating, deleting, renaming, and moving files. Both machines are running the latest Mountain Lion release.

Simple synchronization (via rsync or unison) does not appear to be appropriate because they synchronize all files to both locations. This means that if I have deleted a file while on the road and I wish that delete to be reflected in my local copy when I sync, that won't happen and instead the previously deleted file will reappear on the mobile copy.

Somehow I need a solution that is smart enough to recognize files/directories that have been deleted, as well as those that have been renamed. This almost sounds like something I need to use SVN for but I've never used that outside of a software development environment where it was all set up for me to use. I don't know how I would go about implementing that in my own home environment.

Is there a Mac OS X compatible solution to this issue? If so, I would really appreciate a pointer in the right direction.

share|improve this question

2 Answers 2

If I understand correctly you wish an automated action that'll start comparing the directory modification dates, select the one that's the most recently touched, and use this info to define who is to be duplicated onto the other.

(this is the only way to decide if a file exists on one side only because it has just been created (then copy it) or because it lies in the oldest folder (then delete it).

I think this should be at reach with some scripting, but am not wise enough to do it... This said, as you mention, such a process not being a proper SVN, you really risk propagating an erroneous delete, which personally I wouldn't like...

You also have readymade synchronization apps ("Synk" comes to mind) that indeed are able to handle these conflicts, but my version is 3 years old and I'm not sure it doesn't just "stop and ask" in case of a conflict when syncing both ways. Maybe you can get the last demo version and try -this would be faster than scripting.

share|improve this answer

Unison will ask you if you want to propagate a deletion, rename, addition, etc., from one directory to the other. You can change the direction of propagation: e.g., if you're running Unison with your home workstation as the 'left' root and the portable HD as the 'right' root, and if you deleted a directory on the portable, Unison will by default suggest propagating the change from 'left' to 'right', i.e. it will offer to restore the directory on the HD. But you can then change that to go from 'right' to 'left' (by pressing <), so that the directory will be deleted from your workstation.

It will work like this for all changes. Remember, change propagation is bi-directional, and you can change the direction for every change.

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.