Bi-Directional Sync Apps

Discussion in 'Mac Basics and Help' started by nathanlukewong, Jun 8, 2009.

  1. nathanlukewong macrumors newbie

    Joined:
    May 10, 2009
    #1
    Hi there,
    I was wondering if there are any good bi-directional sync apps for mac?
    I have had a look around and could not find any. Any advice would be great.
    What I am trying to do is sync two folders (one on my computer and another on my USB stick) and have those two folders sync'ed. Most programs I have found just sync from one folder to another but I would like it two way Ie if I create a new file on the USB stick and uni and also create a new file on my computer at home, I would like both these files to sync.
    Any ideas would be great
    Thanks in advance
    Nathan
     
  2. jsw Moderator emeritus

    jsw

    Joined:
    Mar 16, 2004
    Location:
    Andover, MA
    #2
    There are probably some pre-built apps that do just that. However, if not, you can look into using rsync. It's easy to use, and you'd run it twice (once to sync one way, again to sync the other way).
     
  3. nathanlukewong thread starter macrumors newbie

    Joined:
    May 10, 2009
    #3
    thanks JSW,
    I have seen that program.... just seems a bit annoying doing it twice :(
    I use to own a PC and used allway sync, fantastic program
     
  4. jsw Moderator emeritus

    jsw

    Joined:
    Mar 16, 2004
    Location:
    Andover, MA
    #4
    I agree it's annoying. I'm sure there's an app that does what you want, but I figured I'd post a workaround until someone more knowledgeable posted a link to that app. :) Worst case, a script would handle it for you, so you'd just run it once. Ideally, it'd be something that'd run automatically whenever the USB drive was mounted.
     
  5. indigotheory macrumors regular

    Joined:
    May 1, 2009
  6. oletimer macrumors newbie

    Joined:
    Jun 8, 2009
    #6
    rsync not bi-directional

    Rsync is not a good solution for bi-directional sync. If you "run it twice," you'll replace modified files with the old versions on the first run, then not have the modified file available for the second run.

    Unison, on the other hand, works very well, and even has a Mac GUI: http://www.cis.upenn.edu/~bcpierce/unison/
     
  7. nathanlukewong thread starter macrumors newbie

    Joined:
    May 10, 2009
    #7
    Cheers will look into it :D
     
  8. i.shaun macrumors 6502a

    i.shaun

    Joined:
    May 1, 2008
    Location:
    Canada
    #8
    I just can't seem to figure out rsync, it keeps linking to random files and code as if I need to program something in order for it to run (which I don't know how to do).


    Oh well, I figured I would look into syncing for my own purposes which is to backup files I create on my Internal HDD to a folder on the External (rather than manually copying stuff over every so often).



    I actually found out Automator can (possibly) work too. Open it, select "Finder" and find the action that says "copy finder items". Drag it to the right

    Get it to copy files to a specific folder, say "Backups" for example, and tell it to replace existing files. Save-as plugin, select "folder action" and attach it to another folder. Now when you drop an item like an HTML file in, it copies it to the other folder. If you edit the HTML file, it replaces the one in the other folder with the edited one.

    If you re-created the script in automator, but set it up opposite ways (Ie, copy to the other folder that you attached the original folder action to) it should copy both ways.


    I just tested it like this:

    Copy finder items to: External HDD/Test Folder (save-as, folder action)
    Attach folder action to: Desktop/untitled

    Copy finder items to: Desktop/untitled (save-as, folder action)
    Attach folder action to: External HDD/Test Folder



    It works to some degree, but doesn't seem to know what to do when you update a file such as code inside an HTML file, or if you change the name of a file. Changing the name in one folder creates another file in the other folder. So re-naming "untitled.html" to "testpage.html" will just leave you with 2 HTML files in the other folder:

    untitled.html
    testpage.html

    Alternatively, it tries to copy only the newly added "testpage.html" to the other folder -- but that folder already contains the file, since that's the one you re-named. It does not 'refresh' and copy all folder contents back and forth (so one folder has just "test.html" and the other has both "untitled.html" & "test.html"



    I'll keep messing with it and see if I can get it to work better somehow.
     
  9. i.shaun macrumors 6502a

    i.shaun

    Joined:
    May 1, 2008
    Location:
    Canada
    #9
    alright I found This automator action

    What you do is install it into automator (file>import actions)


    Drag it to the side, then drag 2 folders above it (this will create a "get specified items" action. It will use the 2 folders you specify in order to do it's work.


    You should have the workflow like this:

    Get specified finder items:
    (it will display the 2 folders you dragged)

    Backup Folder
    Back up: first folder into second folder
    Pass on: both (both folders goes to next action)
    don't check "delete extra files"

    Backup Folder (same action, drag it into the workflow a second time)
    Backup: second folder into first folder
    pass on: both (it doesn't matter what this is set to because this is where the workflow ends)


    I tested it out, and if I made changes to any of the two folders, it backed them up accordingly. This automator method still has a problem with re-named files -- it will copy the re-named file to the other folder, then the other folder will copy the original file back giving you 2 copies of the file in each folder.


    Example:
    Re-name image.jpg in FOLDER ONE to domokun.jpg

    Run Workflow. . it takes FOLDER ONE, and copies "domokun.jpg" into FOLDER TWO

    FOLDER TWO still has image.jpg, and FOLDER ONE no longer does -- so it copies image.jpg back to FOLDER ONE.

    Now both folders have duplicate images with different names.




    Another problem is I can't seem to get it to work as a folder action (ie, excecute on adding a new item to folder). It works fine from automator, but you'd need some way to invoke it automatically. I can use keyboard maestro to do my backups on every login or at time intervals, but I'm not sure how you would want to go about it if you did this.
     
  10. jsw Moderator emeritus

    jsw

    Joined:
    Mar 16, 2004
    Location:
    Andover, MA
    #10
    Not if you use the right options. For me, the following works:
    Code:
    rsync -avrzogtpu /Users/jsw/mystuff/ /Volumes/flashdrive/ 
    rsync -avrzogtpu /Volumes/flashdrive/ /Users/jsw/mystuff/
    
    The 'u' option ensures the newest files aren't overwritten.
    I've tried it, and, honestly, I think the GUI is less than intuitive. However, in the end, all that matters is that it works for you. :)
     
  11. boing macrumors newbie

    Joined:
    Jun 28, 2006
    #11
    There are no right options, and what you are using doesn't work 100% for bi-directional.

    First off do you realize using the "-a" argument equals "-rlptgoD". So to make yours shorter and do the same use "rsync -avzu". That removes the duplicates you are issuing.

    Now the flaw in your logic?? It doesn't handle file deletes. You want to see where your suggestion goes wrong then:

    DELETE a file from /Users/jsw/mystuff/ and then run your script. What will happen:

    1) rsync -avrzogtpu /Users/jsw/mystuff/ /Volumes/flashdrive/ - This doesn't erase the file removed on /Users/jsw/mystuff/ from /Volumes/flashdrive/

    so...

    2) rsync -avrzogtpu /Volumes/flashdrive/ /Users/jsw/mystuff/ - This will copy the file back from /Volumes/flashdrive/ to /Users/jsw/mystuff/.

    No solution with rsync will handle bi-directional deletes. You need to use something like Unison.

    Nice try, I made the same mistake in that logic.
     
  12. boing macrumors newbie

    Joined:
    Jun 28, 2006
    #13
    chronosync is MAC only and cost $

    Unison is free, and is available for multiple systems (you could use it to sync between MAC, Linux, and Solaris if you wanted).

    So Unison is a good one to look at.
     
  13. nathanlukewong thread starter macrumors newbie

    Joined:
    May 10, 2009
    #14
    update...

    found a new program called synkron, work checking out does what i need it to :)
     

Share This Page