FTP Script (Automating)
I'm trying to automate an ftp script so that it ftp's to various servers (rs001, rs002, rs003....) and send a file... and no, RCP won't work in my case.
But here's my script so far. STORES="001 002 003 004 005" for store in ${STORES} do ftp rs${store} <<ENDFTP send file1 bye ENDFTP done Now for some reason the script won't work and keeps giving this same error msg. "syntax error: unexpected end of file" can't someone help me with this? Note: I didn't use ftp -n because i don't need to enter password/user since when i use "ftp rs001" the login is automated already. Any help much appreicated. |
An example script of an FTP GET ... all you need to do is to convert that to STORE (and adjust user-details of course):
Code:
#!/bin/sh |
sorry for the double post, but the first post i think i buggered up cuz i hit 'back' by mistake. But the script above needs to be in a loop. I can make it do a one time get/send but i need to use the ftp script within a loop. Everytime i put it in a for loop it gives me unexpected end of file error which i don't know where it's coming from.
edit: i have about 100 different ftp servers i need to ftp ONE file to, so having the server (store) ips within a file it'll be quicker to have the script loop back rather than having 100 independent ftp gets. |
All times are GMT -5. The time now is 01:32 PM. |