Other Help Topics :: publish a file to a ftp site from terminal
I need to copy a file (CalendarDataFile.ics) to my ftp-site, i need to do this from a script. So i need a command to copy a file to a ftp-site and in this file i need to state the password for the ftp-site. Sorha like the bookmark-synchroniser in Firefox (passive transfer is not possible so i need to state the password)
_ftp () { echo "open $PEER1 user $PEER1UPASS bin prompt put $FILENAME $FILENAME close bye" | ftp -i -in
that should do it. ;) enjoy. if you have any more questions lemme know. (should work w/bash too #/bin/bash--but i dont use bash)PEER1="members.chello.nl" PEER1UPASS="bbbbb" FILENAME="~/dsl.png"
my host = members.chello.nl username = aaaaa password = bbbbb
how do i run the script? (i called it ftpup) where do i insert my username? (for the ftp-site)You may want to read the ftp manpage, since tronic's script makes some assumptions about your knowledge, and is also slightly broken (unterminated function).
username and password are both entered with the PEER1UPASS variable PEER1UPASS="username password".
also i don't think the filename "~/dsl.png" will work, since the variable uses the same filename for both local and remote. If you are in ~/ when you run the prog you can just use "dsl.png"Ah...well my script is fine...but there is no } ;\ I think i wrote it when i woke up early this morning?
And PEER1UP works if you're calling the ftp with the username you'll be accessing on remote system otherwise, make it PEER1UPASS="user password"
Just add an } at the end of the file.
You call the script with /bin/sh script or you can chmod u+x script and then run it from the cwd as ./scriptNext Page...
original here.