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: Put -delete -filemask... Failing (seemingly simple script)

Not sure what performance hits you assume. Comparing to what?
Guest

Re: Put -delete -filemask... Failing (seemingly simple script)

NICE! Thanks Martin.
I think my original problem was the "direction" of the > or <
My brain said they should be opposite and I used the wrong one.

Working as expected. Any performance hits with the -filemask tag?
martin

Re: Put -delete -filemask... Failing (seemingly simple script)

The source parameter of the put command is mandatory.
https://winscp.net/eng/docs/scriptcommand_put
So this would work:
put -delete -filemask="*.tif>=1N" *
put -delete -filemask="*.txt>=2N" *

but this is more straightforward way to do the same (basically what you did originally)
put -delete *.tif>=1N
put -delete *.txt>=2N

Or oneliner:
put -delete *.tif>=1N *.txt>=2N
todda.jones@kmbs

Re: Put -delete -filemask... Failing (seemingly simple script???)

< 2022-08-23 16:12:40.245 Script: sftpXXX:/Incoming/Sweeps
> 2022-08-23 16:12:40.245 Script: put -delete *.tif >1N
< 2022-08-23 16:12:40.245 Script: Are you sure you want to transfer multiple files to a single file '>1N' in a directory 'sftpXXX:/Incoming/Sweeps'?
< 2022-08-23 16:12:40.245 The files will overwrite one another.
< 2022-08-23 16:12:40.245 If you actually want to transfer all files to a directory 'sftpXXX:/Incoming/Sweeps/>1N/', keeping their name, make sure you terminate the path with a slash.
. 2022-08-23 16:12:40.245 Copying 3 files/directories to remote directory "sftpXXX:/Incoming/Sweeps" - total size: 802,120
 
< 2022-08-23 16:12:40.558 Status code: 20, Message: 1799, Server: The filename, directory name, or volume label syntax is incorrect. , Language: en
* 2022-08-23 16:12:40.558 (ETerminal) The filename is not valid.
* 2022-08-23 16:12:40.558 Error code: 20
* 2022-08-23 16:12:40.558 Error message from server (en): The filename, directory name, or volume label syntax is incorrect.
. 2022-08-23 16:12:40.558 Asking user:
. 2022-08-23 16:12:40.558 Cannot create remote file 'sftpXXX:/Incoming/Sweeps/sftpXXX:/Incoming/Sweeps/>1N.filepart'. ("The filename is not valid.

Trying to accomplish this:
put and delete tif files older than 1 minute
then
put and delete txt files older than 2 minutes

Attempting the following:
put -delete -filemask="*.tif<=1N" *
todda.jones@kmbs

Put -delete -filemask... Failing (seemingly simple script)

Have a script that is failing.
Originally, the below statement worked:
put -delete *

This also worked:
put -delete *>=1N

Trying to split out the files as below is failing:
put -delete -filemask="*.tif>=1N"
put -delete -filemask="*.txt>=2N"

Any thoughts on what I'm doing wrong?