Solved

FTP script for automatic files copy?

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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Port forwarding 14 154
What Can't I Connect by FTP??? 27 102
How do I remove / delete my personal information from a website? 9 93
Expanding Subnet Mask 20 111
Data center, now-a-days, is referred as the home of all the advanced technologies. In-fact, most of the businesses are now establishing their entire organizational structure around the IT capabilities.
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.
Viewers will learn how to connect to a wireless network using the network security key. They will also learn how to access the IP address and DNS server for connections that must be done manually. After setting up a router, find the network security…
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…

832 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