MacFTPTools for Mac OS X
This tool neable you to synchronize a local folder with a remote FTP site.
The files/folders indicated on the command line will be synchronized with the ones eventually present on the FTP site.
A file will be uploaded only if it is more recent than the one present on the FTP site FTP or if it's size is different.
In order to synchronize the file "input.txt" with the one eventually present on the folder "titi/tutu" on the site ftp.domain.net
The option -q ("quiet") will remove all output to the terminal.
In this example the user "user_name" has an account with password "user_password" on the ftp server "ftp.domain.net".
$ /usr/local/bin/fput -u ftp://user_name:user_password@ftp.domain.net -C titi/tutu -q input.txt |
The option -v ("verbose") enable you to get more feedback during the synchronization of the file "input.txt".
Since in this tutorial, we have already synchronized the file "input.txt", fput will detect that the file present on the FTP site has a more recent date than the one locally present and has the same size. The file is not transfered to the FTP server.
$ /usr/local/bin/fput -u ftp://user_name:password@ftp.domain.net -C titi/tutu -v input.txt fput: connecting to FTP server ftp.domain.net... Serveur de mise a jour des pages perso de domain.net version [Feb 7 2005 13:55:51] fput: logging in as user user_name fput: not updating file input.txt fput: disconnecting |
The option -d ("debug") enable you to follow the exchange with the FTP server.
$ /usr/local/bin/fput -u ftp://user_name:user_password@ftp.domain.net -C titi/tutu -d -v input2.txt fput: connecting to FTP server ftp.domain.net... <<< 220 Serveur de mise a jour des pages perso de domain.net version [Feb 7 2005 13:55:51] fput: logging in as user user_name >>> USER user_name <<< 331 Password required for user_name. >>> PASS user_password <<< 230 User user_name logged in. >>> FEAT <<< 500 'FEAT': command unrecognized. >>> SYST <<< 215 UNIX Type: L8 >>> PWD <<< 257 "/" is current directory. >>> TYPE I <<< 200 Type set to I >>> CWD titi/tutu <<< 250 CWD command successful. >>> PWD <<< 257 "/titi/tutu" is current directory. >>> PASV <<< 227 Entering Passive Mode (212,27,63,3,203,166). >>> LIST -la <<< 150 Opening ASCII mode data connection for file list <<< drwx------ 5 web site 248 Nov 6 15:06 . <<< drwx------ 3 web site 72 Oct 21 21:10 .. <<< -rw-r--r-- 1 web site 53 Nov 9 21:38 input.txt <<< 226-Transfer complete. <<< 226 Quotas: utilisation de 105 Mo sur les 1024 Mo fput: uploading: input2.txt => input2.txt... >>> PASV <<< 227 Entering Passive Mode. >>> STOR input2.txt <<< 150 Opening BINARY mode data connection for input2.txt <<< 226 Transfer complete. fput: disconnecting >>> QUIT <<< 221 Goodbye. |
It is of course possible to use these specials caracters `*', `?'. For example, if you want to synchronize all HTML files (with extension .html).
$ /usr/local/bin/fput -u ftp://user_name:user_password@ftp.domain.net -C titi/tutu -v *.html |
It is also possible to synchronize folders and to use more thant one file at the same time. In the following example, one will synchronize all HTML and JPEG files of the current folder and the folders "folder1" et "folder2" (with theirs contents).
$ /usr/local/bin/fput -u ftp://user_name:user_password@ftp.domain.net -C titi/tutu -v *.html *.jpeg folder1 folder2 |
Usage: fput [options] file ... Options: [-dNpqsvV] [-u urlftp] [-C dir] [-I urlfile] [-m max_connections] [-t timeout] [-T num_retries] [-i cache_interval] [-M max_cache_size] |
More details on the option usage will be soon available
© Philippe Laval, 2003-2006