Solved

FTP script for automatic files copy?

Posted on 2007-04-11
6
1,921 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
  • 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

Easy, flexible multimedia distribution & control

Coming soon!  Ideal for large-scale A/V applications, ATEN's VM3200 Modular Matrix Switch is an all-in-one solution that simplifies video wall integration. Easily customize display layouts to see what you want, how you want it in 4k.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How to Create Separate Guest WiFi VLAN on Netgear R8000 19 83
Dns issues 4 46
Running a 2nd company from the same location 3 58
Freeproxy running on Server 2012 R2 2 116
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
PRTG Network Monitor lets you monitor your bandwidth usage, so you know who is using up your bandwidth, and what they're using it for.
In this video, we discuss why the need for additional vertical screen space has become more important in recent years, namely, due to the transition in the marketplace of 4x3 computer screens to 16x9 and 16x10 screens (so-called widescreen format). …
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…

765 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