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 &[/code] 3. that's all.
Shorter URL
Want to share or tweet this post? Please use this short URL: http://ozh.in/k
thanks..that helped !
Thanks. That solved my problem. I had tried "ftp
You may consider using "expect" for automating ftp, telnet etc.
Antz » indeed, didn't know this, and it looks rather nice and simple to use. Thanks for the suggestion.
how to use ftp behind proxy ftp or firewall, please give me the sample script. Thanks.
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
nice one. very helpful. thanks for sharing.
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!!