Scripting FTP for new/modified files to go from remote server to local server.

Advertisement

securitym4n
Guest

Scripting FTP for new/modified files to go from remote server to local server.

Hi all, I have been working on this script to try to get new files or changed files from an email directory and upload them to a database server. I have been trying to do this with both scripting and PowerShell code but I haven't been successful yet. Here is what I have for the script:

# Automatically answer all prompts negatively not to stall
# the script on errors
option batch off
 
# Disable overwrite confirmations that conflict with the previous
option confirm off
 
open usr:pass@ftp.domain.com
 
# If you need to change directory eg..(cd /cme/ftp/940/Outgoing)
cd /futr/9AR
 
lcd "C:\Shares\Data\W\9AR\"
 
synchronize local -preservetime *.csv
 
synchronize local -filemask="*>=1D" c:\hares\Data\W\9AR\*
synchronize local "C:\Shares\Data\W\9AR\" "/futr"
 
Disconnect
close
exit
This is the error it gives me:

help.png

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
40,587
Location:
Prague, Czechia

Re: Scripting FTP for new/modified files to go from remote server to local server.

The synchronize command takes directory path only, so no *:
synchronize local -filemask="*>=1D" c:\hares\Data\W\9AR

Reply with quote

Advertisement

You can post new topics in this forum