Les transferts FTP répétitifs peuvent être effectués en mode batch grace à la
commande ftp du mode DOS, dont l'aide en ligne existe sous DOS et Windows (voir
extrait de l'aide en fin d'article).
Le principe est de créer un fichier de commandes contenant les instructions pour
effectuer le transfert, et d'appeler ftp en mode commande pour exécuter ce fichier
de commandes (ceci pouvant être masqué par un raccourci).
par exemple pour transférer le fichier essai.txt vers la machine
(adresse IP ou nom de machine), le fichier de commande
envoiftp.cmd pourrait contenir:
open themachine
user anonymous nom@domaine
cd répertoire_cible
lcd c:\data
ascii
put essai.txt
bye
La commande pour effectuer l'envoi en mode batch serait:
ftp -i -n -v -s:envoiftp.cmd
Commande FTP sous DOS:
Transfers files to and from a computer running an FTP server service
(sometimes called a daemon). Ftp can be used interactively.
FTP [-v] [-d] [-i] [-n] [-g] [-s:filename] [-a] [-w:windowsize] [host]
-v Suppresses display of remote server responses.
-n Suppresses auto-login upon initial connection.
-i Turns off interactive prompting during multiple file
transfers.
-d Enables debugging.
-g Disables filename globbing (see GLOB command).
-s:filename Specifies a text file containing FTP commands; the
commands will automatically run after FTP starts.
-a Use any local interface when binding data connection.
-w:buffersize Overrides the default transfer buffer size of 4096.
host Specifies the host name or IP address of the remote
host to connect to.
|