Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Looping FTP

Status
Not open for further replies.

THOR01

MIS
Jul 26, 2007
35
US
We are wanting to test some network issues and I am wanting to ftp the same 2GB file (so it over-writes it's self)over and over for about 10 times in the same ftp session then quit the session and end.


Thanks for your time on this!
 
#!/bin/sh
ftp -in hostname<<EOF
user username password
put file1
put file1
put file1
.
.
.
EOF

Mike

"Whenever I dwell for any length of time on my own shortcomings, they gradually begin to seem mild, harmless, rather engaging little things, not at all like the staring defects in other people's characters."
 
Thanks y'all..

The Kermit looks interesting and may look into using it.
Mike, what you show is what I'm doing but it only sends the file once and go's EOF.

I'm wanting to send the same file over and over again.
ie.

#!/bin/ksh

ftp -in EFT_SPS_02 << EOF
user username password
lcd /data/
cd /data/
bin

put myfile.txt
put myfile.txt
put myfile.txt

quit
EOF


This is what I have but it only sends "myfile.txt" once.
 
How about if you do it this way:

Code:
#!/bin/ksh

ftp -in EFT_SPS_02 << EOF
user username password
lcd /data/
cd /data/
bin

put myfile.txt

quit
EOF

wait

ftp -in EFT_SPS_02 << EOF
user username password
lcd /data/
cd /data/
bin

put myfile.txt

quit
EOF

wait

ftp -in EFT_SPS_02 << EOF
user username password
lcd /data/
cd /data/
bin

put myfile.txt

quit
EOF

If this still doesn't work then you can try removing the wait statement with sleep 50 for example!

Regards,
Khalid
 
I believe that will do the trick.

Thanks again for your time..
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top