Solved

FTP script for automatic files copy?

Posted on 2007-04-11
6
1,916 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
Comment Utility
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
Comment Utility
Task Scheduler that is, not Task Manager.
0
 
LVL 40

Assisted Solution

by:omarfarid
omarfarid earned 250 total points
Comment Utility
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
Comment Utility
Hi,

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

Thanks
0

Featured Post

Network it in WD Red

There's an industry-leading WD Red drive for every compatible NAS system to help fulfill your data storage needs. With drives up to 8TB, WD Red offers a wide array of solutions for customers looking to build the biggest, best-performing NAS storage solution.  

Join & Write a Comment

Meet the world's only “Transparent Cloud™” from Superb Internet Corporation. Now, you can experience firsthand a cloud platform that consistently outperforms Amazon Web Services (AWS), IBM’s Softlayer, and Microsoft’s Azure when it comes to CPU and …
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 …
This video Micro Tutorial explains how to clone a hard drive using a commercial software product for Windows systems called Casper from Future Systems Solutions (FSS). Cloning makes an exact, complete copy of one hard disk drive (HDD) onto another d…
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…

744 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now