kam_uk
asked on
FTP script to automatically download files
Hi there
I have created an FTP site on a server, ftp://server.domain.com
This site will be used by a test group of clients to download their Anti-virus DAT files, rather than connecting to the internet all the time.
However, I would like a way for my FTP site to automatically download these files from the vendor's FTP daily, rather than this being a manual process.
Does anyone know how I can go about doing this? I was thinking of some sort of script/ batch file.
Many thanks!
I have created an FTP site on a server, ftp://server.domain.com
This site will be used by a test group of clients to download their Anti-virus DAT files, rather than connecting to the internet all the time.
However, I would like a way for my FTP site to automatically download these files from the vendor's FTP daily, rather than this being a manual process.
Does anyone know how I can go about doing this? I was thinking of some sort of script/ batch file.
Many thanks!
ASKER
Thanks Steve for the quick answer.
Sorry, I am not much of a script man - so apologies if I am stating the obvious here, but just to confirm -
Say if the files I wanted to download were at
ftp://ftp.mcafee.com/pub/datfiles/english/dat.zip
and I wanted to download them to C:\McAfee downloads on my local machine, then the script would be:
---begin file ftp.txt ---
USER anonymous
cd pub/datfiles/english/
dat.zip
prompt n
mget *.*
--end file ftp.txt ---
with the second script being
---begin ftpdownload.bat ----
@echo off
cd c:\McAfee downloads
ftp -s:ftp.txt ftp.mcafee.com
--- end ftpdownload.bat ----
Thanks again dude.
Cheers
Sorry, I am not much of a script man - so apologies if I am stating the obvious here, but just to confirm -
Say if the files I wanted to download were at
ftp://ftp.mcafee.com/pub/datfiles/english/dat.zip
and I wanted to download them to C:\McAfee downloads on my local machine, then the script would be:
---begin file ftp.txt ---
USER anonymous
cd pub/datfiles/english/
dat.zip
prompt n
mget *.*
--end file ftp.txt ---
with the second script being
---begin ftpdownload.bat ----
@echo off
cd c:\McAfee downloads
ftp -s:ftp.txt ftp.mcafee.com
--- end ftpdownload.bat ----
Thanks again dude.
Cheers
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks!
Out of interest, what does the temp.txt file do?
Out of interest, what does the temp.txt file do?
Standard FTP file:
username
password
The change directory command on the FTP server
Setting of binary mode for well binary information :)
I guess the prompt n suppresses prompts for automation purposes.
Finally, the mget *.* gets all files in the directory we changed to on the server.
username
password
The change directory command on the FTP server
Setting of binary mode for well binary information :)
I guess the prompt n suppresses prompts for automation purposes.
Finally, the mget *.* gets all files in the directory we changed to on the server.
ASKER
and your 18 lines above replaces both files and should be set as a .bat file, or do I still need the ftp.txt (or temp.txt as you call it) file?
One file, no need for a supplemental file as _temp.txt is dynamically created and then destroyed.
ASKER
Excellent - many thanks mate!!
The comment by broeckske outlines this process. Post back if you need any additional help.