Any Terminal command similar to DOS 'replace'

Discussion in 'Apple' started by Tim Murray, Nov 13, 2004.

  1. Tim Murray

    Tim Murray Guest

    For the unfamiliar, the replace command, in DOS, worked something like what
    you might call a "sync". Given a folder A and B, a replace could copy A into
    B, but any given file would copy only (1) if a same-named file already
    existed in B; and (2) optionally only if A is newer.

    Is there anything similar in Terminal, or, a GUI tool?
     
    Tim Murray, Nov 13, 2004
    #1
    1. Advertisements

  2. psync seems to be included with the OS as far as I can tell, should
    work.

    I'm not sure of ditto's behavior, but that too might be worth trying.
     
    Jerry Kindall, Nov 13, 2004
    #2
    1. Advertisements

  3. Tim Murray

    Kyle Jones Guest

    RsyncX is pretty close.

    http://www.versiontracker.com/dyn/moreinfo/macosx/16814

    rsync --archive --update --existing folder-a/ folder-b/

    It has a usable GUI as well as a command line interface, and
    you'll want to use it instead of the normal rsync at samba.org
    because RsyncX's rsync will copy resource forks.
     
    Kyle Jones, Nov 13, 2004
    #3
  4. Tim Murray

    Dave Seaman Guest

    You must not have looked very hard; rsync is in /usr/bin and it has a
    man page. I use it in a nightly cron job to synchronize two directories
    on my home machine from the office.
     
    Dave Seaman, Nov 13, 2004
    #4
  5. Psync is not included with Mac OS X.
     
    Tom Harrington, Nov 13, 2004
    #5
  6. Wonder how it got there, then... maybe with the dev tools...
     
    Jerry Kindall, Nov 14, 2004
    #6
  7. Tim Murray

    respower Guest

    I also have psync, in /usr/local/bin, and it's definitely not something
    I installed intentionally. It's part of a group of Mac-specific file
    utilities, all perl scripts: psync, pcpmac, psetfinfo, pgetfinfo,
    pmvmac. A google search leads here:

    http://search.cpan.org/~dankogai/MacOSX-File/

    How or when they got installed, I have no idea.
     
    respower, Nov 14, 2004
    #7
  8. Tim Murray

    Alice Faber Guest

    When I installed Carbon Copy Cloner, some part of the installer asked me
    if I wanted psync. Don't know how you got it, though.
     
    Alice Faber, Nov 14, 2004
    #8
  9. Tim Murray

    Dave Seaman Guest

    Nothing in /usr/local/bin is part of OS X. In fact, if you look at a
    brand new Mac, even with the Developer Tools installed, you will discover
    that it has a /usr/local directory, but it is empty. There is no
    /usr/local/bin, or /usr/local/include, or /usr/local/lib, or
    /usr/local/etc, or /usr/local/anything-else, until you create one
    yourself or use a third-party installer that creates it for you.

    The whole point is that /usr/local is a generally-recognized place to
    install local or third-party software so that it will not be overwritten
    the next time you do an OS update.
    Most likely you were installing something else via cpan that had these as
    a prerequisite.

    If you have the Developer Tools installed (and if you added
    /Developer/Tools to your PATH), then I don't see why you would want these
    perl scripts, except that it might be easier for perl developers to set
    up dependencies on other perl modules rather than on vendor-supplied
    software that is not guaranteed to be installed on every Mac.
     
    Dave Seaman, Nov 14, 2004
    #9
  10. That's probably it.

    But as I realized after I posted, psync probably doesn't know about
    resources.
     
    Jerry Kindall, Nov 14, 2004
    #10
  11. Tim Murray

    respower Guest

    Did I say it was?

    I've known all this for years, but thanks anyway.

    Did I say I wanted them?


    What I said was that some unknown application or installer puts these
    things in /usr/local/bin. Other posters have said that the CCC
    installer includes them, but as I've never even downloaded CCC, much
    less run its installer, this is not where I got them.
     
    respower, Nov 14, 2004
    #11
  12. Psync was written specifically with Mac OS X in mind, and as such will
    handle resource forks correctly.

    Personally I prefer rsyncX, but Psync is safe for use with Mac files.
     
    Tom Harrington, Nov 15, 2004
    #12
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.