FTP the file

Hi,

I am dynamically getting the path of the file name i should FTP.

For eg: the files to be FTP'd are stored in a txt file like below

Run_20110420_124500/EventType_40000/4000/Run_20110512_120000.zip
Run_20110420_124500/EventType_40000/4000/Run_20110512_1200001.zip
Run_20110420_124500/EventType_40000/4000/Run_20110512_1200002.zip
Run_20110420_124500/EventType_40000/4000/Run_20110512_1200002.zip

So now how can i FTP all these files as i cant do a cat inside FTP.

Please let me know the ways to FTP all the above files.

Thnx,
Vinoth

If the text file is at your machine from where you need to take the files, then you can simply use a loop and do it.

If the text file is also at your remote machine, the i would first ftp files list to my machine then run the ftp for each file.

Why can't convince your client to use scp. It is better.

you can use this:

In filename u can write all file's name.

while read file
do
ftp -nvi  hostname <<EOF
echo "user $username $password"
echo "bin"
echo "cd /pub"
echo "get $file"
echo "quit"
EOF
done < files_list.txt

file_list.txt is the file you have mentioned here. you may redirect the ftp messages to /dev/null