its nice to see such a forum still around. Batch files are sooo very useful at automating some tasks.
I'm writing a script to pull datalogs from an offsite FTP server.
I'm having trouble finding way to write it so that the Script when pulling data does not auto-overwrite old files on local.
the server generates data files at say 10files a day and keeps a backlog of up to a month. I'm trying not to have to pull all 300+ files everyday just to have the few most updated files in my system. extremely bad for server since i'm not the only one doing such monitoring
in dos, theres the "Echo n | copy *.* c:\store" where it will auto N to overwrite.
can we do the same for Dos FTP?
Thanks people
Code: Select all
REM FTP System311Monitoring Daily Script
REM Going to storage Directory
cd System311Monitoring
REM Creating temporary script file
> script.ftp ECHO <username>
>>script.ftp ECHO <password>
>>script.ftp ECHO hash
>>script.ftp ECHO cd DataStore
>>script.ftp ECHO ascii
>>script.ftp ECHO prompt n
>>script.ftp ECHO mget *SysMon311*.*
>>script.ftp ECHO bye
:: Use the temporary script for unattended FTP
FTP -v -d -s:script.ftp <ftp address>
:: Delete script file after use.
DEL script.ftp
REM Back to Root directory
cd ..
REM FTP Log Pull Script Complete