Solved

FTP script for automatic files copy?

Posted on 2007-04-11
6
1,924 Views
Last Modified: 2013-11-30
Hi,
I want to get files from a server and on this server there is an FTP server defined. i need a script that allow me to get files from this sever in a certin folder and put it on  another server in a certain folder. the files are continuously modified, the script must get the files from there at every change occur. so there must be a way to automate the process.

0
Comment
Question by:ajalboush
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
6 Comments
 
LVL 38

Expert Comment

by:Shift-3
ID: 18889594
You can write a batch script to automate FTP sessions.
http://support.microsoft.com/kb/96269

From what you describe it sounds like you need one script like this to do the download from the first server:
lcd c:\localfolder
open server1
username
password
cd /usr/foldername
binary
prompt n
mget *.*
bye

And a second one to upload to the second server:
lcd c:\localfolder
open server2
username
password
cd /usr/otherfoldername
binary
prompt n
mput *.*
bye

Scheduling these two scripts to run at short intervals in Task Manager should accomplish what you want.
0
 
LVL 38

Accepted Solution

by:
Shift-3 earned 250 total points
ID: 18889596
Task Scheduler that is, not Task Manager.
0
 
LVL 40

Assisted Solution

by:omarfarid
omarfarid earned 250 total points
ID: 19059469
hi
on a unix box you may run the following shell script
# the lines below will run on the local host
cd /localdir
# next lines will connect to remote server where the files to get
ftp server1 << end1
cd /remotedir
bin
prompt
mget *
end1
# next lines will connect to remote server where to send the files
ftp server2 << end2
cd /remotedir
bin
prompt
mput *
end2

now for the above to run, you need to store the user names and passwords of the two server in a file on your server which ftp can use to login to these servers. as you could see i did not put any user name or password in the script itself. you need to read the man page of ftp to see what is the file name , its content and where to keep it. note that the file should not give any read to group or others.

if you need more info, you are welcome.
0
 
LVL 40

Expert Comment

by:omarfarid
ID: 19250644
Hi,

I think the answer was provided. Why the points can not be given based on your judgment?

Thanks
0

Featured Post

Plug and play, no additional software required!

The ATEN UE3310 USB3.1 Gen1 Extender Cable allows users to extend the distance between the computer and USB devices up to 10 m (33 ft). The UE3310 is a high-quality, cost-effective solution for professional environments such as hospitals, factories and business facilities.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When you try to share a printer , you may receive one of the following error messages. Error message when you use the Add Printer Wizard to share a printer: Windows could not share your printer. Operation could not be completed (Error 0x000006…
This article is in regards to the Cisco QSFP-4SFP10G-CU1M cables, which are designed to uplink/downlink 40GB ports to 10GB SFP ports. I recently experienced this and found very little configuration documentation on how these are supposed to be confi…
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
Suggested Courses
Course of the Month11 days, 18 hours left to enroll

623 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question