Search Members Help

» Welcome Guest
[ Log In :: Register ]

Mini-ITX Boards Sale, Fanless BareBones Mini-ITX, Bootable 1G DSL USBs, 533MHz Fanless PC <-- SALE $200 each!
Get The Official Damn Small Linux Book. DSL Market , Great VPS hosting provided by Tektonic
 

[ Track this topic :: Email this topic :: Print this topic ]

reply to topic new topic new poll
Topic: publish a file to a ftp site from terminal, what command to use?< Next Oldest | Next Newest >
Patrick Offline





Group: Members
Posts: 333
Joined: Sep. 2004
Posted: Feb. 18 2005,12:05 QUOTE

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)

Help?


--------------
Usb-stick sandisk cruzer titanium 512 Mb:
DSL 2.3 (final)
Firefox (Mozilla 1.06)
WM -biff  -cdplay -clockmon -smixer -usic -top -net -biff -ifinfo -cpuload
gps vnc LinNeighborhood (samba) QtParted bdc
xawtv imagemagick xplanet
Back to top
Profile PM WEB 
tronik Offline





Group: Members
Posts: 182
Joined: Dec. 2004
Posted: Feb. 18 2005,14:00 QUOTE

Code Sample
#/bin/sh
PEER1="host port"
PEER1UPASS="password"
FILENAME="file.tgz"

_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)


--------------
-william
atlanta, GA, USA

DSL 1.0+2.4.27/sata : P4 2.4norwood : 512ddr2 : nvgf4ti4200-64 : 128mbLexar Jumpdrive Elite
Back to top
Profile PM WEB 
Patrick Offline





Group: Members
Posts: 333
Joined: Sep. 2004
Posted: Feb. 18 2005,14:22 QUOTE

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)


--------------
Usb-stick sandisk cruzer titanium 512 Mb:
DSL 2.3 (final)
Firefox (Mozilla 1.06)
WM -biff  -cdplay -clockmon -smixer -usic -top -net -biff -ifinfo -cpuload
gps vnc LinNeighborhood (samba) QtParted bdc
xawtv imagemagick xplanet
Back to top
Profile PM WEB 
mikshaw Offline





Group: Members
Posts: 4856
Joined: July 2004
Posted: Feb. 18 2005,14:59 QUOTE

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"


--------------
http://www.tldp.org/LDP/intro-linux/html/index.html
Back to top
Profile PM WEB 
tronik Offline





Group: Members
Posts: 182
Joined: Dec. 2004
Posted: Feb. 18 2005,19:38 QUOTE

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  ./script


--------------
-william
atlanta, GA, USA

DSL 1.0+2.4.27/sata : P4 2.4norwood : 512ddr2 : nvgf4ti4200-64 : 128mbLexar Jumpdrive Elite
Back to top
Profile PM WEB 
4 replies since Feb. 18 2005,12:05 < Next Oldest | Next Newest >

[ Track this topic :: Email this topic :: Print this topic ]

 
reply to topic new topic new poll
Quick Reply: publish a file to a ftp site from terminal

Do you wish to enable your signature for this post?
Do you wish to enable emoticons for this post?
Track this topic
View All Emoticons
View iB Code