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: Upload today files with multiple includes and excludes

That's because you have dropped the mandatory "source" parameter.
See https://winscp.net/eng/docs/scriptcommand_put
Your original script had "uploaddir".
Newatthis

Re: Upload today files with multiple includes and excludes

That makes sense. However, I am getting the following error (I trimmed down the script to just one file for the purpose of testing:)
> 2022-07-28 10:39:25.651 Script: put -filemask="filename*.BZ2>=today;" -resumesupport=50000 -rawtransfersettings[2] ExcludeHiddenFiles=1 ExcludeEmptyDirectories=1
> 2022-07-28 10:39:25.651 Script: Switch:    -filemask=filename*.BZ2>=today;
> 2022-07-28 10:39:25.651 Script: Switch:    -resumesupport=50000
> 2022-07-28 10:39:25.651 Script: Switch:    -rawtransfersettings=2
> 2022-07-28 10:39:25.651 Script: Parameter: ExcludeHiddenFiles=1
> 2022-07-28 10:39:25.651 Script: Parameter: ExcludeEmptyDirectories=1
< 2022-07-28 10:39:25.651 Script: Missing parameter for command 'put'.
. 2022-07-28 10:39:25.651 Script: Failed
. 2022-07-28 10:39:25.651 Session upkeep
. 2022-07-28 10:39:25.651 Script: Exit code: 1
. 2022-07-28 10:39:25.652 Closing connection.
. 2022-07-28 10:39:25.652 Sending special code: 1
. 2022-07-28 10:39:25.660 Detected network event
. 2022-07-28 10:39:25.660 Session sent command exit status 0
. 2022-07-28 10:39:25.660 Main session channel closed
. 2022-07-28 10:39:25.661 All channels closed.
martin

Re: Upload today files with multiple includes and excludes

You have to specify the time constraint at each of the file mask:
-filemask="filename*.BZ2>=today; filename*.json>=today; ..."
Newatthis

Upload today files with multiple includes and excludes

I had this working with synchronize but I just found out that the files will be removed from the destination site daily, so I am looking at using put instead.

Only trouble I am having is finding the correct syntax using the today keyword with multiple file includes and excludes (it works if I don’t specify files created “today” )

Code is below, I changed the file names for privacy reasons, but the structure of the script is the same.
lcd "S:\folder1\folder2\Home\"
cd "/remote/Home/"
 
put -filemask=">=today; filename*.BZ2; filename*.json; 01*.PSV; 02*.PSV; 03*.PSV; 06*.PSV; 05*.PSV;07*.PSV; 08*.PSV; 09*.PSV; 10*.PSV; 11*.PSV | *.PDF; *.DON; *.txt; filename*.PSV; dirname/" -resumesupport=50000 -rawtransfersettings[2] ExcludeHiddenFiles=1 ExcludeEmptyDirectories=1 "uploaddir"
 
exit

Anyone have examples of doing this or better yet know what I am doing wrong with my script?