Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I come primarily from a Windows background, migrating over to Mac. I've used WinSCP and loved a featured called "Keep Remote Directory Up To Date".

Here's the question: is there an equivalent SCP client for OSX that will monitor a directory for changes and upload when detected? I don't care if it's a GUI client or via command-line (rsync, ssh, etc).

share|improve this question
up vote 0 down vote accepted

Your best bet is probably to use Folder Actions and adapting the new item alert script to your needs, issuing a call to the command line utility of your choice.

share|improve this answer

Check out Transmit by Panic. From one of their blog posts, a commenter said:

One of my favorite features, that some people may not know, when you open a document into a certain application in Transmit (let’s say an .html file into BBEdit) then edit the document and Save it; Transmit automatically uploads it back to the server to the same file, no questions asked. It works wonders when making websites and editing CSS. Also convenient to make small corrections in images through Photoshop. You can also handle how Transmit deals with certain file extensions through the Prefs.

share|improve this answer
I've looked into Transmit - unfortunately it doesn't support SCP - only SFTP connections. Also, Transmit refuses to open my private key files. – pygorex1 Jan 12 '11 at 2:24
This feature is something different. It just means you can directly edit files from the remote server using the editor of your choice. Other FTP programs also support this. – Daniel Beck Jan 12 '11 at 5:38

I have come across a ruby script that does what you need, but it will take a little adapting.

rsync whenever the directory the script is in changes using the OS X FSEvents API

share|improve this answer

You may use launchd instead of folder actions (to get some sample code just google for: launchd folder watcher).

You may then combine you launchd folder watcher item with a scp script similar to this one.

Or, use rsync over ssh like so:

rsync -urltv --delete -e ssh /path/to/dir othermachine:/path/to/dir

For a commercial cross-platform software solution see GoodSync.

share|improve this answer

Well, I had the same kind of problem and it is possible using these together: rsync, SSH Passwordless Login, Watchdog (a Python sync utility) and Terminal Notifier (an OS X notification utility made with Ruby. Not needed, but helps to know when the sync has finished).

  1. I created the key to Passwordless Login using this tutorial from Dreamhost wiki:

    1.1. When you finish, test if everything is ok… if you can't Passwordless Login, maybe you have to try afp mount. Dreamhost (where my site is) does not allow afp mount, but allows Passwordless Login. In terminal, type:

    ssh You should login without passwords being asked :P

  2. I installed the Terminal Notifier from the Github page:

    2.1. I used the Gem installer command. In Terminal, type:

    gem install terminal-notifier

    2.3. Test if the notification works.In Terminal, type:

    terminal-notifier -message "Starting sync"

  3. Create a sh script to test the rsync + notification. Save it anywhere you like, with the name you like. In this example, I'll call it ~/Scripts/ I used the ".sh extension, but I don't know if its needed.

    #!/bin/bash terminal-notifier -message "Starting sync" rsync -azP ~/Sites/folder/ terminal-notifier -message "Sync has finished"

    3.1. Remember to give execution permission to this sh script. In Terminal, type:

    sudo chmod 777 ~/Scripts/ 3.2. Run the script and verify if the messages are displayed correctly and the rsync actually sync your local folder with the remote folder.

  4. Finally, I downloaded and installed Watchdog from the Github page:

    4.1. First, I installed the libyaml dependency using Brew (there are lot's of help how to install Brew - like an "aptitude" for OS X). In Terminal, type:

    brew install libyaml

    4.2. Then, I used the "easy_install command". Go the folder of Watchdog, and type in Terminal:

    easy_install watchdog

  5. Now, everything is installed! Go the folder you want to be synced, change this code to your needs, and type in Terminal:

      watchmedo shell-command
          --patterns="*.php;*.txt;*.js;*.css" \
          --recursive \
          --command='~/Scripts/' \

    It has to be EXACTLY this way, with the slashes and line breaks, so you'll have to copy these lines to a text editor, change the script, paste in terminal and press return.

    I tried without the line breaks, and it doesn't work!

    In my Mac, I always get an error, but it doesn't seem to affect anything:

    /Library/Python/2.7/site-packages/argh-0.22.0-py2.7.egg/argh/ UserWarning: Bash completion not available. Install argcomplete.

    Now, made some changes in a file inside the folder, and watch the magic!

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .