vendredi 1 juillet 2011

ftp file transfert

sur linux ou windows exist un client ftp qu'on pt utiliser pour envoyer des fichier sur des serveur ftp:
windows :

E:\Documents and Settings\alkimiste> ftp ftp.freehostia.com
Connecté à ftp.freehostia.com.
230 User belbad logged in.

linux :


FTP (file transfer protocol)

This is mostly used to copy files between computers. It doesn't support compression. It is also not encrypted. This is how to transfer files. To connect to foo.com
ftp foo.com
You will have to enter your username and password when prompted. If the file being transferred is a binary file (yes, PDF and PS are binary files), type the following.
binary
To upload your file wolf.pdf to the directory in foo.com
cd /home/arul/backup
put wolf.pdf
To download the file arul.ps from the directory in foo.com
get arul.ps

Shell Script to automate upload using FTP

I wrote this simple shell script to automate upload and download of files.. just customise it according to your use.
#!/bin/bash

HOST='foo.com'
USER='us3r'
PASSWD='p4ssword'

ftp -i -n $HOST <<Arul
user ${USER} ${PASSWD}

binary
cd /home/arul/backup
put wolf.pdf
get arul.ps

quit
Arul

Aucun commentaire:

Enregistrer un commentaire

Nombre total de pages vues