Topic "Script help - multiple "get" statements"

Author Message
[View user's profile]

Joined: 2015-11-24
Posts: 1
Location: MA
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: /script=E:\test\winscp\eltsftp.txt


# 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 s

#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
#Exit the Winscp application


[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 27106
Location: Prague, Czechia
Please attach a full log file showing the problem (using the latest version of WinSCP).

To generate log file, use /log=path_to_log_file command-line argument. Submit the log with your post as an attachment. Note that passwords and passphrases not stored in the log. You may want to remove other data you consider sensitive though, such as host names, IP addresses, account names or file names (unless they are relevant to the problem). If you do not want to post the log publicly, you can mark the attachment as private.

You can post new topics in this forum


What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!


About donations

$9   $19   $49   $99

About donations


WinSCP Privacy Policy

WinSCP License