Hi,
I'm trying to create a loop to ftp files from different servers.
The script i'm using to ftp a file from one server is as follows, and i'm scratching my head how to make this a loop that will do ftp from different servers.
FILE_NAME="ULOG.`date +"%m%d%y"`"
HOST='MY-IP'
USER='USER'
PASSWD='PASSWORD'
ftp -nv <<EOF
open $HOST
user $USER $PASSWD
cd /opt/tuxedo/logs/d2d_2
get $FILE_NAME
EOF
mv ULOG.`date +"%m%d%y"` ULOG.T$i.`date +"%m%d%y"`
done
[Modified the part of script which i actually got from our forum.]
Here i'm renaming the transferred file so as to differentiate it from the other log file.
My friend gave me a idea like create a file which contains all the other server's credentials and make the script to read that file and so that it makes ftp while the loop is running, but i could not able to catch up how to implement that, even he too
So if any of you guys have any idea on how to implement this loop would be a great help for me.
Thank you in advance.
With Best Regards,
Bhargav Kesavan.