Post a reply

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

martin

Re: trying to exclude directories in simple get command

Just add double-quotes:

get -delete -filemask="monthly*201608*.data; /data/outbox/ | /data/outbox/teamfolder/; /data/outbox/sentfolder/" c:\destinationFolder\monthly
spm08fsu

heres the relevant portion of the log


> 2016-08-08 12:37:32.767 Script: get -filemask=monthly*201608*.data| */ /data/OUTBOX/ c:\destination\monthly
. 2016-08-08 12:37:32.767 Listing directory "/ingest/source/*".
> 2016-08-08 12:37:32.767 Type: SSH_FXP_OPENDIR, Size: 26, Number: 523
< 2016-08-08 12:37:32.798 Type: SSH_FXP_STATUS, Size: 29, Number: 523
< 2016-08-08 12:37:32.798 Status code: 2, Message: 523, Server: No such file, Language:
. 2016-08-08 12:37:33.438 Asking user:
. 2016-08-08 12:37:33.438 Error listing directory '*'. ("No such file or directory.
. 2016-08-08 12:37:33.438 Error code: 2
. 2016-08-08 12:37:33.438 Error message from server: No such file")
< 2016-08-08 12:37:33.438 Script: Error listing directory '*'.
< 2016-08-08 12:37:34.079 Script: No such file or directory.
< 2016-08-08 12:37:34.079 Error code: 2
< 2016-08-08 12:37:34.079 Error message from server: No such file
. 2016-08-08 12:37:34.079 Script: Failed
> 2016-08-08 12:37:34.079 Script: close
. 2016-08-08 12:37:34.079 Closing connection.
. 2016-08-08 12:37:34.079 Sending special code: 12
. 2016-08-08 12:37:34.079 Sent EOF message
spm08fsu

trying to exclude directories in simple get command

My main goal here is to pull all files that conform to the below mask from /data/outbox. Ive noticed it works but it pulls in additional folders.

Using Winscps "edit File Mask" gui I was able to get this:

monthly*201608*.data; /data/outbox/ | /data/outbox/teamfolder/; /data/outbox/sentfolder/


so the command in the script looks like this:

get -delete -filemask=monthly*201608*.data; /data/outbox/ | /data/outbox/teamfolder/; /data/outbox/sentfolder/ c:\destinationFolder\monthly


I am very unsure of the syntax however, I've tried a bunch of variation of that but still cannot get it to work. It works if I remove the exclusions , but then it pulls in those directories (empty), or in the case of the teamfolder it deletes it. Has anyone gotten this to work and wouldnt mind sharing their syntax?