Help my sync my folders
August 9, 2006 2:07 PM   Subscribe

I spend an increasingly large amount of time in FTP client. Is there any way to set up a simple FTP sync script on OS X? I want to edit a file on my machine, hit save and it gets automatically uploaded to the relevant place on my FTP server(s).

If the upload doesn't work, it puts it in a queue for later upload. So, if the connection drops or you are at 30,000 feet, it will upload it later. Basically, make it so that I can remove another step from the whole process. Similarly, if you delete something, or move something, it should do so on the server. Basically, the server does everything that happens on my machine. And, preferably, it shouldn't cost anything.
posted by tommorris to Computers & Internet (11 answers total)
 
I think you'd be better off with something like "rsync", which is intended to work with ssh instead of ftp. I use it for stuff like this all the time. For example, I sync my mp3s from home to work like this:

rsync --exclude=__Styles --bwlimit=20 -avP "home.example.com:/mp3/" ./music/

This excludes the directory "__Styles" because it's really just a collection of links, limits the bandwidth to 20K/s (optional, I do this so I don't kill the connection here at work).

It's free, and it may be available on your OSX installation already (I don't know much about OSX). It's unix-ish so if it's not there already it can probably be downloaded or built.
posted by RustyBrooks at 2:10 PM on August 9, 2006


Oh, and rsync is quite smart, smart enough to only transfer files that are new, to tranfer a file again if it failed the first time, etc. It also works on local-to-local copies, so it's a nice way to keep, say, two directories on a drive in sync, or sync between, say, a thumb drive and a hard drive.
posted by RustyBrooks at 2:11 PM on August 9, 2006


If you don't want to script something or find unix-ish stuff too arcane, Transmit has some synchronization functionality as well.
posted by mikeh at 2:27 PM on August 9, 2006


Seconding rsync. If you want, you can set up a cron (scheduled task) to run the rsync command every five minutes or so.
posted by splatta at 2:28 PM on August 9, 2006


What you want is an Interarchy "FTP disk." It maintains a local mirror of your site and automatically synchronizes it with the remote site (both ways).
posted by kindall at 2:50 PM on August 9, 2006


Transmit's "edit with" doesn't quite fullfil the requirement of catching up with failed downloads later. Interarchy has this feature too but again all you'll get is an error message.

I third rsync. It's easy to install on Mac OS X -- depending on version, it may already be installed -- and with cron you can just have it run every five minutes or something. And CronniX is a nice Mac GUI for Cron.

If you can't get the rsync syntax, just ask here and we'll help you.

kindall, can you explain to me exactly when an FTP Disk updates/syncs itself? I couldn't quite get it. It seemed to be "when it feels like it".
posted by AmbroseChapel at 4:56 PM on August 9, 2006


I will third the vote for Transmit: it was worth my money, and I'm a total cheapskate. A free alternative to Transmit is Fugu. It will let you edit a remote file using a local editor. I believe it will only do text files though, and it isn't as flexible with respect to what editor you can use. Also, note I think that it will only do SCP/SFTP, not regular old FTP.
posted by drmarcj at 7:32 PM on August 9, 2006


A second free alternative (and in my opinion, better than Fugu) is Cyberduck. Find the file you want, hit edit and use one of the nicer OS X editors (SubEthaEdit, TextMate, etc.), and save connects directly to upload. For this connection to work it has to use the OS X bindings, so VIM and Emacs are out, unfortunately.
posted by RobotAdam at 9:35 PM on August 9, 2006


kindall, can you explain to me exactly when an FTP Disk updates/syncs itself?

A few seconds after you modify a file in the local repository, plus once an hour or so to pick up changes to the remote site.
posted by kindall at 9:48 PM on August 9, 2006


How to Backup Your Mac With rsync

rsnycx is a GUI for rsnyc
posted by kirkaracha at 7:26 AM on August 10, 2006


This hint over at MacOSXHints has an Applescript solution for this exact problem using Transmit and a local disk image. Like others have said here, you can add a cron job (Second recommendation for Cronnix. Fantastic one trick pony.) to do the sync in case a connection isn't available on edit. Scroll down the hint and modify the script as necessary to set up a Folder Action for your local copy for more automatic synching.
posted by jxpx777 at 7:55 AM on August 10, 2006


« Older Washing Machine and Dryer   |   I'm not gay cheap, but my boyfriend is Newer »
This thread is closed to new comments.