Solved

FTP script for automatic files copy?

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

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

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

Short answer to this question: there is no effective WiFi manager in iOS devices as seen in Windows WiFi or Macbook OSx WiFi management, but this article will try and provide some amicable solutions to better suite your needs.
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 …
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…
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…

752 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