LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 09-06-2004, 07:32 AM   #1
jnusa
Member
 
Registered: Jul 2004
Location: Denmark, Aarhus
Distribution: Ubuntu, Suse
Posts: 98

Rep: Reputation: 15
Bash put script


Anyone know where I can find a put procedure to copy several files with one function call (during ftp session). Alternative could be to copy a directory (haven't been able to google anything usefull). Any information will be greatly appriciated.

/Jasper

Last edited by jnusa; 09-06-2004 at 07:33 AM.
 
Old 09-06-2004, 07:43 AM   #2
elsheikhmh
Member
 
Registered: Aug 2004
Location: Cairo, Egypt
Distribution: Slackware
Posts: 101

Rep: Reputation: 15
what about mput and mget instead of put, and get
 
Old 09-06-2004, 02:09 PM   #3
Cedrik
Senior Member
 
Registered: Jul 2004
Distribution: Slackware
Posts: 2,140

Rep: Reputation: 242Reputation: 242Reputation: 242
You can use curl, say for upload all jpeg files in current directory :

Code:
#!/bin/bash

UPLOAD_DIRECTORY="$PWD"
FTP_PASS="password"
FTP_USER="me"
FTP_HOST="ftp.myhost.com"
FTP_DIR="/path/to/upload/files/in/ftp/server"
FTP_URL="ftp://$FTP_USER:$FTP_PASS@$FTP_HOST/$FTP_DIR"
FTP_UP=

for image in `find $UPLOAD_DIRECTORY -name "*.jpg"`; do
    image_name=`basename $image`
    FTP_UP="$FTP_UP -T $image $FTP_URL/$image_name"
done
curl  $FTP_UP

Last edited by Cedrik; 09-06-2004 at 02:10 PM.
 
Old 09-07-2004, 02:31 AM   #4
jnusa
Member
 
Registered: Jul 2004
Location: Denmark, Aarhus
Distribution: Ubuntu, Suse
Posts: 98

Original Poster
Rep: Reputation: 15
exactly what I'm looking for.... appriciate it Cedrik.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
bash: put output from `ls` into an array samel_tvom Programming 18 07-31-2005 12:55 AM
[bash] Put words from file to array mispunt Programming 4 11-04-2004 10:53 AM
Where to put iptables script? tentolga Linux - Networking 9 08-28-2004 07:39 AM
put my user logon instead of bash prompt little_ball Slackware 10 04-13-2004 01:57 PM
How & where to put script? snakedriver Linux - Newbie 2 01-21-2004 07:11 PM


All times are GMT -5. The time now is 07:31 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration