NAME ftpsync - FTP sync or copy tool. Synchronize a remote arborescence from a local directory by using FTP. $Revision: 1.81 $ INSTALL Get ftpsync at http://www.linux-france.org/prj/ftpsync/dist/ tar xzvf ftpsync-x.xx.tgz # x.xx is the version number Read the INSTALL file. freshmeat record: http://freshmeat.net/projects/ftpsync/ SYNOPSIS ftpsync [options] SOURCE DEST ftpsync [--host server] [--port ] [--user ] [--passfile ] [--pattern ] [--excludelist ] [--hash] [--force] [--delete] [--norecursive] [--nostat] [--dry] [--debug] [--debugftp] [--version] SOURCE DEST ftpsync --help ftpsync DESCRIPTION The command ftpsync is a tool allowing incremental and recursive FTP transfer from a local directory to a remote FTP-served directory. We sometimes need to mirror a set of files on a remote ftp server. The perfect tool (rsync) is not always available. Developing a script invoking a standard FTP client software will cause useless transfers (all files again and again even if they have not changed), and taking subdirectories into account will not be easy. ftpsync is the adequate tool because it reduces the amount of data transfered by not transfering a given local file if the remote copy has an newer date (so the copy is already done and up to date) and the same size (transfert completely done). The difference between system clocks is taken into account using the ftp protocol. ftpsync is somewhat "like" the rsync command but it uses the FTP protocol and only transfers local files to a remote FTP server. Moreover it implements the missing 'recursive PUT' FTP command. OPTIONS Invoke: ftpsync --help HISTORY I wrote ftpsync because I could not find a good working ftp client able to recursively update remote ftp servers from a local directory. Several softwares tested were buggy. They can get (remote to local) recursively (ftpsync can't and won't be able to do that) but can not easily put (local to remote) recursively. EXAMPLES While working on ftpsync parameters please run ftpsync in dry mode (no modification induced) with the --dry option. Nothing bad can be done this way. To copy recursively directory d1/ on remote ftp server ftp.foo.org: ftpsync --host ftp.foo.org --user bob --passfile /etc/secret \ dir1 /pub/mystuff/dir1 or use the following syntax (URI syntax in DEST): ftpsync --user bob --passfile /etc/secret \\ dir1 ftp://ftp.foo.org/pub/mystuff/dir1 Then, you will have /pub/mystuff/dir1/ content on the remote server updated from the local directory dir1/ You can remove recursively a directory (or several) with the --del option: ftpsync --user bob --passfile /etc/secret --host ftp.foo.org \\ --del /pub/mystuff/dir1 --del /pub/mystuff/dir2 EXIT STATUS ftpsync will exit with a 0 status (return code) if everything went good. Otherwise, it exits with a non-zero status. So if you have a buggy internet connection, you can use this loop in a Bourne shell: while ! ftpsync ...; do echo ftpsync not complete done SPECIAL BEHAVIOR If you want a special behavior (passive etc.) then use environment variables as documented in the Net::FTP manual (run command "perldoc Net::FTP" then read :-)) For example: FTP_PASSIVE=1; export FTP_PASSIVE ftpsync ... AUTHOR Gilles LAMIRAL lamiral@linux-france.org LICENSE ftpsync is free, gratis and open source software cover by the GNU General Public License. See the GPL file included in the distribution or the web site http://www.gnu.org/licenses/licenses.html BUGS The FTP protocol can not create remote hard or symbolic links, nor special file like devices etc. ftpsync can only do what ftp also can. Symbolic links are ignored. Hard links are treated like normal files since they are normal files. If the system clocks on both side are very different then you can encounter problems since ftpsync use the modification time to determine if a remote file has to be updated. This problem only occurs if files on both side are the same size. This problem is fixed since release 1.65 but I leave this comment here in case you encounter it again. Some ftp proxies don't like the "-a" option with the dir() function. Fix ftpsync by removing -a and test... Report any bugs to the author: lamiral@linux-france.org SIMILAR SOFTWARES Recently Nat found similar free open and gratis tools. See also (I did not test them): http://sourceforge.net/projects/ftpsync/ http://www.geocities.com/z_design_studio/ftpsync.html Feedback will be welcome. $Id: ftpsync,v 1.81 2006/10/29 04:24:38 gilles Exp gilles $