•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the Shell Scripting section within the Software Development category of DaniWeb, a massive community of 423,318 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 5,310 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Shell Scripting advertiser: Programming Forums
Views: 874 | Replies: 1
![]() |
•
•
Join Date: Jul 2007
Posts: 1
Reputation:
Rep Power: 0
Solved Threads: 0
I have written a shell script for transfering files from ftp1 to ftp2.
In ftp1 there can be any number of directories,For eg
under sourdedir (mentioned below)there can be any number of directories
eg /opt/lampp/htdocs/scrap/test1/
under test1
1.7505-----1.zip
2.2505------2.zip
In each of the subdirectories there wilI have written a shell script for transfering files from ftp1 to ftp2.
In ftp1 there can be any number of directories,For eg
under sourdedir (mentioned below)there can be any number of directories
eg /opt/lampp/htdocs/scrap/test1/
under test1
1.7505-----1.zip
2.2505------2.zip
In each of the subdirectories there will be a zipped file, I need to put all the zipped files from ftp1 to ftp2(destdir---20070620)
The following file is present in ftp2
The following is the code(downloadfile.sh) which doesnot work.
It gives me invalid command error
ftphost=ftp1(ip)
user=khgkhkghkg
pass=jhgjfjgfgkfjg
# Directory from where you want to pick up the files created on the local system
sourcedir=/opt/lampp/htdocs/scrap/test1/
#Directory where you want the files to be placed on remote system
destdir=/opt/lampp/htdocs/scrap/web/eco-1.3.11/public_html/seo/merchantfiles/20070620
#Switch to Source Dir on Host
cd $destdir
#Name of the file
#Perform Ftp Transfer
ftp -nv << EOF
open $ftphost
user $user $pass
binary
cd $sourcedir
for i in `$sourcedir`
do
prompt
get $i
mput *.*
done
quit
EOF
exit
l be a zipped file, I need to put all the zipped files from ftp1 to ftp2(destdir---20070620)
The following file is present in ftp2
The following is the code(downloadfile.sh) which doesnot work.
It gives me invalid command error
ftphost=ftp1(ip)
user=khgkhkghkg
pass=jhgjfjgfgkfjg
# Directory from where you want to pick up the files created on the local system
sourcedir=/opt/lampp/htdocs/scrap/test1/
#Directory where you want the files to be placed on remote system
destdir=/opt/lampp/htdocs/scrap/web/eco-1.3.11/public_html/seo/merchantfiles/20070620
#Switch to Source Dir on Host
cd $destdir
#Name of the file
#Perform Ftp Transfer
ftp -nv << EOF
open $ftphost
user $user $pass
binary
cd $sourcedir
for i in `$sourcedir`
do
prompt
get $i
mput *.*
done
quit
EOF
exit
Pls can u check and post me the reply as early as possible
In ftp1 there can be any number of directories,For eg
under sourdedir (mentioned below)there can be any number of directories
eg /opt/lampp/htdocs/scrap/test1/
under test1
1.7505-----1.zip
2.2505------2.zip
In each of the subdirectories there wilI have written a shell script for transfering files from ftp1 to ftp2.
In ftp1 there can be any number of directories,For eg
under sourdedir (mentioned below)there can be any number of directories
eg /opt/lampp/htdocs/scrap/test1/
under test1
1.7505-----1.zip
2.2505------2.zip
In each of the subdirectories there will be a zipped file, I need to put all the zipped files from ftp1 to ftp2(destdir---20070620)
The following file is present in ftp2
The following is the code(downloadfile.sh) which doesnot work.
It gives me invalid command error
ftphost=ftp1(ip)
user=khgkhkghkg
pass=jhgjfjgfgkfjg
# Directory from where you want to pick up the files created on the local system
sourcedir=/opt/lampp/htdocs/scrap/test1/
#Directory where you want the files to be placed on remote system
destdir=/opt/lampp/htdocs/scrap/web/eco-1.3.11/public_html/seo/merchantfiles/20070620
#Switch to Source Dir on Host
cd $destdir
#Name of the file
#Perform Ftp Transfer
ftp -nv << EOF
open $ftphost
user $user $pass
binary
cd $sourcedir
for i in `$sourcedir`
do
prompt
get $i
mput *.*
done
quit
EOF
exit
l be a zipped file, I need to put all the zipped files from ftp1 to ftp2(destdir---20070620)
The following file is present in ftp2
The following is the code(downloadfile.sh) which doesnot work.
It gives me invalid command error
ftphost=ftp1(ip)
user=khgkhkghkg
pass=jhgjfjgfgkfjg
# Directory from where you want to pick up the files created on the local system
sourcedir=/opt/lampp/htdocs/scrap/test1/
#Directory where you want the files to be placed on remote system
destdir=/opt/lampp/htdocs/scrap/web/eco-1.3.11/public_html/seo/merchantfiles/20070620
#Switch to Source Dir on Host
cd $destdir
#Name of the file
#Perform Ftp Transfer
ftp -nv << EOF
open $ftphost
user $user $pass
binary
cd $sourcedir
for i in `$sourcedir`
do
prompt
get $i
mput *.*
done
quit
EOF
exit
Pls can u check and post me the reply as early as possible
Last edited by abc12345 : Jul 11th, 2007 at 1:38 am.
•
•
Join Date: Dec 2004
Location: London or Slovakia
Posts: 2,432
Reputation:
Rep Power: 11
Solved Threads: 295
and why did you send me personal message? I'm not into shell scripts if you check my profile!
Also how many other people got the message from you too?
Please do not miss use members list in future. Post your question and if anybody know answer they will answer it.
Also how many other people got the message from you too?
Please do not miss use members list in future. Post your question and if anybody know answer they will answer it.
Last edited by peter_budo : Jul 11th, 2007 at 6:48 am.
Learn to see in another's calamity the ills which you should avoid.
Publilius Syrus
(~100 BC)
If we helped you to solve your problem, answered your question please mark your post as SOLVED.
Publilius Syrus
(~100 BC)
If we helped you to solve your problem, answered your question please mark your post as SOLVED.
![]() |
•
•
•
•
•
•
•
•
DaniWeb Shell Scripting Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
- How do you transfer files using crossover cable? (Windows NT / 2000 / XP / 2003)
- ?Transfer files between pc.? (Windows NT / 2000 / XP / 2003)
- VMWare - transfer files - aaahh! please help (*nix Software)
- Cannot transfer files from one hardrive to another =[ please help (Windows NT / 2000 / XP / 2003)
Other Threads in the Shell Scripting Forum
- Previous Thread: use of mail in MKS
- Next Thread: script not working in RedHat Linux.



Linear Mode