Upload today files with multiple includes and excludes

Advertisement

Newatthis
Joined:
Posts:
2

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?

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,478
Location:
Prague, Czechia

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; ..."

Reply with quote

Newatthis
Joined:
Posts:
2

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.

Reply with quote

Advertisement

You can post new topics in this forum