1. create a script file :
-
open ftp.domain.com
-
user mylogin mypasswd
-
lcd /my/local/dir
-
put myfile
-
bye
-
quit
2. call the script :
-
ftp -inv <script &
3. that's all.
Shorter URL
Want to share or tweet this post? Please use this short URL: http://ozh.in/k

wrote, on 21/Oct/04 at 1:39 pm # :
thanks..that helped !
thought, on 28/Jul/05 at 4:52 pm # :
Thanks. That solved my problem. I had tried "ftp
replied, on 15/Sep/07 at 6:29 pm # :
You may consider using "expect" for automating ftp, telnet etc.
said, on 15/Sep/07 at 8:43 pm # :
Antz » indeed, didn't know this, and it looks rather nice and simple to use. Thanks for the suggestion.
wrote, on 09/Oct/07 at 1:29 pm # :
how to use ftp behind proxy ftp or firewall, please give me the sample script. Thanks.
commented, on 15/Dec/07 at 2:28 am # :
Yeah that works but to put it inside of a script, this is the solution:)
ftp -ivn <<EOL
open FTP_SERVER
user USERNAME PASSWORD
lcd /path/to/file
put file
bye
quit
EOL
said, on 10/Dec/08 at 6:48 pm # :
nice one. very helpful. thanks for sharing.
commented, on 18/May/09 at 11:56 pm # :
simplest solution I found so far.. I'm an iSeries admin and know peanuts about Linux. I need to setup a small demo which involves FTP between various servers.. out of all soutions I came across this was the best for my purpose! Thanks a ton!!