Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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'm searching for some software that watches a folder and when you change a file it automatically uploads it. I don't like programs that mount a remote dir as a local folder, since they are really sluggish if you have a slow network connection.

share|improve this question
Does it really have to be ftp? Can you not use rsync-over ssh? – Zoredache Mar 9 '12 at 23:45
up vote 2 down vote accepted

You want something that hangs off inotify to get the real-time aspect of this.

Obvious commercial choices are DropBox and, similar free choices include SparkleShare, and some other DropBox clones.

You can also use lsyncd to get real-time rsync driven sync, or inoticoming, or inosync, or inocron, or iwatch to drive the process.

If you really need FTP and not something fancier, you want to look at the later suggestions, which are more flexible about how the react to file changes.

share|improve this answer

If you're running OSX you can accomplish this with AppleScript by setting up a 'folder script' in the specific folder. It will upload every new file to the FTP server or even update when a file inside the folder is edited.

Here's an example script that can be updated to be able to run as a folder script:

Uploads the given file or folder to the given remote ftp folder using "curl".
If you need user/password to login to such server, append it to the URL. Eg:

filePath: file path, alias, posix path (a file or folder)
remoteDir: ftp directory (eg: "" or "")

upload(alias "path:to:dir:", "")

to upload(filePath, remoteDir)
   global baseLocalFolder, baseRemoteFolder, ftpHome, ftpDir
   script nesteed
       to guessNewDir(f) -- "/path/to/footest" --> /footest
           set prevTids to AppleScript's text item delimiters
           set AppleScript's text item delimiters to POSIX path of parent's baseLocalFolder
           set f to item -1 of f's text items
           set AppleScript's text item delimiters to prevTids
           return f
       end guessNewDir
       to breakURL(d) --> "" --> {"", "/html/docs"}
           set prevTids to AppleScript's text item delimiters
           set AppleScript's text item delimiters to "/"
           set ftpHome to "" & items 1 thru 3 of d's text items
               set ftpDir to "/" & items 4 thru -1 of d's text items
           on error
               set ftpDir to "/"
           end try
           set AppleScript's text item delimiters to prevTids
           return {ftpHome, ftpDir}
       end breakURL

       to processUnknownItem(f, remoteDir)
           set f to f as text
           if f ends with ":" then
               processFolder(f, remoteDir)
               do shell script "curl -T " & quoted form of POSIX path of f & space & quoted form of remoteDir
           end if
       end processUnknownItem
       to processFolder(f, remoteDir)
           set newDir to guessNewDir(POSIX path of f) --> "/footest"
           try --> avoid existing dirs
               if newDir is not "" then do shell script "curl -Q " & quoted form of ("MKD " & parent's ftpDir & newDir) & space & parent's ftpHome
           end try
           set itemList to list folder alias f without invisibles
           repeat with i in itemList
               processUnknownItem(alias (f & i), parent's ftpHome & parent's ftpDir & newDir)
           end repeat
       end processFolder
   end script
   set wasError to false
       set filePath to filePath as Unicode text
       if filePath does not contain ":" then set filePath to POSIX file filePath as Unicode text
       if remoteDir does not end with "/" then set remoteDir to remoteDir & "/"

       if filePath ends with ":" then --> mirror dir
           -- curl -Q "MKD /html/docs/test"

           set baseLocalFolder to filePath
           set baseRemoteFolder to remoteDir
           set {ftpHome, ftpDir} to breakURL(remoteDir) of nesteed --> {"", "/html/docs"}

           processFolder(filePath, remoteDir) of nesteed
           do shell script "curl -T " & quoted form of POSIX path of filePath & space & quoted form of remoteDir
       end if
   on error msg number n
       set wasError to true
   end try
   set baseLocalFolder to missing value
   set baseRemoteFolder to missing value
   set ftpHome to missing value
   set ftpDir to missing value
   if wasError then error msg number n
end upload

property |version| : 1.0
property author : "Pescados Software @"
property |date| : date "sábado, 17 julio 2004 22:20:27"
property license : "freeware, open-source"
share|improve this answer

Your Answer


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.