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.
1. create a script file :
2. call the script :
3. that's all.
This entry "Automated FTP script"
was posted on 26/01/2004 at 9:18 pm and is tagged with Bash, Code, Linux
Watch this discussion : Comments RSS 2.0.
You can trackback this post from your own site
The last 5 post on planetOzh:
All time popular posts
Read and discover what I've written about:
See the complete archives
I've archived 5919 tracks. The 10 latest are...
See my last.fm profile
My recent bookmarks
Things & stuff (c) Ozh, 1996-2008. Googlebot, look at Ozh so I'm the first "Ozh" in Google's images damn it. Probably valid XHTML, but who cares ? Powered by Wordpress. 45 frags in 2.584 seconds. Pledge your allegiance. I'm a rolling thunder, a pouring rain. I feel so good I feel so numb yeah
commented, on 21/Oct/04 at 1:39 pm # :
thanks..that helped !
commented, on 28/Jul/05 at 4:52 pm # :
Thanks. That solved my problem. I had tried "ftp
wrote, 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.
said, on 09/Oct/07 at 1:29 pm # :
how to use ftp behind proxy ftp or firewall, please give me the sample script. Thanks.
wrote, 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