I'm working for a company who in some circumstances HAVE to deploy php web applications via FTP. I'm in the process of automating the deployment process and need to write a script to FTP the files to the staging and production environments.


  1. Should only transfer new or changed files to the remote server


  1. No shell access of any kind on the remote environments
  2. Not able to use rsync
  3. Only FTP available

My question: Is there any FTP based utility I can employ that fulfils these requirements rather than write my own?


As long as you control the client, you could use FTPFS on the client, then rsync the local directory to the apparently-local-but-really-mounted-via FTPFS directory.

I understand that FTPFS is now part of LUFS.

Edit: I'd love to link to a tutorial, but I normally just start with the project wiki, and something seems to be up with sourceforge right now. CurlFTPFS, which seems to be based on cURL and FUSE, can be found here, and the mounting/unmounting there seems to be as simple as:

$ mkdir sunet
$ curlftpfs ftp://ftp.sunet.se/ sunet/
$ cd sunet/
$ ls -l
total 0
Dr-xr-xr-x   3 root root        96 Feb 23  2004 bin
dr-xr-xr-x   2 root root        72 Mar  2  2004 dev
dr-xr-xr-x   2 root root        48 Feb 23  2004 etc
dr-xr-xr-x   2 root root       120 Feb 23  2004 lib
-rw-r--r--   1 root root 622187310 Mar 11 06:13 ls-lR
-rw-r--r--   1 root root  76389037 Mar 11 06:15 ls-lR.gz
drwxrwxr-x  37 root root      1272 Feb 27 14:17 pub
dr-xr-xr-x   3 root root        72 Feb 23  2004 usr
$ cd ..
$ fusermount -u sunet/
  • Thanks - Do you have any links to a good tutorial? – Ben Waine May 9 '12 at 11:08
  • In the end I decided to go with lftp - the mirror mode was failry trivial to implement. However I also followed your instructions and gave this a try. It works really well to - so am choosing this as answer. – Ben Waine May 9 '12 at 13:19
  • Glad it was helpful and of interest, and above all that you have something in place that works for you! – MadHatter May 9 '12 at 13:41

We use ant for scripting and automation. The ant FTP task has a 'depends' param that transfers only new or changed files http://ant.apache.org/manual/Tasks/ftp.html


Maybe something along the lines of ncftp to sync a directory to the server. You could go as far as to drop that into capistrano (override :deploy and run the ncftp command once you have checked out the version you want to deploy).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.