Script help - multiple "get" statements
I'm trying to automate a process of getting and deleting files from the SFTP server. My issue is that when it gets to the first "get" statement that doesn't have files in the directory, it fails the entire process.
I tried with this line both in the script and not in the script since that is supposed to be the default: option failonnomatch off
I need the script to pull anything in the folder, if nothing move to the next get statement and not fail.
Batch file:
winscp.com /script=E:\test\winscp\eltsftp.txt
Script:
# Automatically abort script on errors
#option batch abort
# Disable overwrite confirmations that conflict with the previous
option confirm off
option failonnomatch off
#Connect to SFTP Server
open sftp://test.com
#Get and delete the customer data files ready for processing on ELT server.
#get -delete /test/upload/currencymaster/*.* E:\ABC\123\INCOMING_FILES\CURRENCYMASTER\
#get -delete /test/upload/customermaster/* get -delete /test/upload/ E:\ABC\123\INCOMING_FILES\CUSTOMERMASTER\
get -delete /test/upload/empmaster/*.* E:\ABC\123\INCOMING_FILES\EMPMASTER\
#get -delete /test/upload/registermaster/* E:\ABC\123\INCOMING_FILES\REGISTERMASTER\
get -delete /test/upload/skumaster/*.* E:\ABC\123\INCOMING_FILES\SKUMASTER\
#get -delete /test/upload/staging/*.* E:\ABC\123\INCOMING_FILES\STAGING\
get -delete /test/upload/storemaster/*.* E:\ABC\123\INCOMING_FILES\STOREMASTER\
#get -delete /test/upload/suppmaster/*.* E:\ABC\123\INCOMING_FILES\SUPPMASTER\
get -delete /test/upload/tloga_1/*.* E:\ABC\123\INCOMING_FILES\TLOGA_1\
#get -delete /test/upload/tlogb_1/* E:\ABC\123\INCOMING_FILES\TLOGB_1\
#Disconnect from SFTP server
close
#Exit the Winscp application
exit
thanks
I tried with this line both in the script and not in the script since that is supposed to be the default: option failonnomatch off
I need the script to pull anything in the folder, if nothing move to the next get statement and not fail.
Batch file:
winscp.com /script=E:\test\winscp\eltsftp.txt
Script:
# Automatically abort script on errors
#option batch abort
# Disable overwrite confirmations that conflict with the previous
option confirm off
option failonnomatch off
#Connect to SFTP Server
open sftp://test.com
#Get and delete the customer data files ready for processing on ELT server.
#get -delete /test/upload/currencymaster/*.* E:\ABC\123\INCOMING_FILES\CURRENCYMASTER\
#get -delete /test/upload/customermaster/* get -delete /test/upload/ E:\ABC\123\INCOMING_FILES\CUSTOMERMASTER\
get -delete /test/upload/empmaster/*.* E:\ABC\123\INCOMING_FILES\EMPMASTER\
#get -delete /test/upload/registermaster/* E:\ABC\123\INCOMING_FILES\REGISTERMASTER\
get -delete /test/upload/skumaster/*.* E:\ABC\123\INCOMING_FILES\SKUMASTER\
#get -delete /test/upload/staging/*.* E:\ABC\123\INCOMING_FILES\STAGING\
get -delete /test/upload/storemaster/*.* E:\ABC\123\INCOMING_FILES\STOREMASTER\
#get -delete /test/upload/suppmaster/*.* E:\ABC\123\INCOMING_FILES\SUPPMASTER\
get -delete /test/upload/tloga_1/*.* E:\ABC\123\INCOMING_FILES\TLOGA_1\
#get -delete /test/upload/tlogb_1/* E:\ABC\123\INCOMING_FILES\TLOGB_1\
#Disconnect from SFTP server
close
#Exit the Winscp application
exit
thanks