Sync Script: Syntax error for filters to exclude certain folders

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
Emre
Posts: 24
Joined: 17 Feb 2016 07:14

Sync Script: Syntax error for filters to exclude certain folders

Post by Emre »

Hello,
I'm using sync scripts to backup my working folders to certain locations on my PC. I generally have an "_EX" folder in everywhere to keep the older versions archived.

I have a working sync script here, I'm tring to add a fiter to exclude the "_EX" folders to sae time and space. But I keep getting syntax errors for this. Can you help me what is worng with my filter section? (censored path adresses too keep simple)

Code: Select all

sync "\\dc\Server\abc\def", "D:\OneDrive\xyz", 1, 0, 4, "c", "-*.bak|-*.dwl|-*.dwl2|-*.txt|-*.skb|-*\_EX";
As usual thanks in advance....

highend
Posts: 13274
Joined: 06 Feb 2011 00:33

Re: Sync Script: Syntax error for filters to exclude certain folders

Post by highend »

I'll give you a hint: Are all your parameters in the correct position?
One of my scripts helped you out? Please donate via Paypal

Emre
Posts: 24
Joined: 17 Feb 2016 07:14

Re: Sync Script: Syntax error for filters to exclude certain folders

Post by Emre »

highend wrote: 11 Dec 2020 08:45 I'll give you a hint: Are all your parameters in the correct position?
Ah.. So I learned to add "7:=". Thanks alot!!!

But I was expecting it to delete the previously synced _EX folders. (I'm selecting it via the dialog box when the script is ran)

Is my syntax searching for any _EX folder or an absolute path? I need to exlude any _EX folder with contents. (just saw that it is still syncing the _EX folders)

highend
Posts: 13274
Joined: 06 Feb 2011 00:33

Re: Sync Script: Syntax error for filters to exclude certain folders

Post by highend »

Read the help file again. Where does the backslash needs to be for folders? Not where you've placed it...
One of my scripts helped you out? Please donate via Paypal

Emre
Posts: 24
Joined: 17 Feb 2016 07:14

Re: Sync Script: Syntax error for filters to exclude certain folders

Post by Emre »

highend wrote: 11 Dec 2020 09:04 Read the help file again. Where does the backslash needs to be for folders? Not where you've placed it...
I tried these alternatives non of them worked. Sorry the help file was not very clear about this, now I'm undestand the backlash has to be at the end but non of these worked:

Code: Select all

7:="-*.bak|-*.dwl|-*.dwl2|-*.txt|-*.skb|-*_EX\";
7:="-*.bak|-*.dwl|-*.dwl2|-*.txt|-*.skb|-_EX\";

highend
Posts: 13274
Joined: 06 Feb 2011 00:33

Re: Sync Script: Syntax error for filters to exclude certain folders

Post by highend »

-*_EX\ works absolutely fine here. All folders called "_EX" are excluded from sync regardless where in the hierarchy they are
One of my scripts helped you out? Please donate via Paypal

Emre
Posts: 24
Joined: 17 Feb 2016 07:14

Re: Sync Script: Syntax error for filters to exclude certain folders

Post by Emre »

highend wrote: 11 Dec 2020 09:14 -*_EX\ works absolutely fine here. All folders called "_EX" are excluded from sync regardless where in the hierarchy they are
Interesting because I even tried it to take it to the beginning of the filter script. I'm deleting the ex folder in the target. The script still copies the folder from the source. In this case I have an odd situation.

Code: Select all

7:="-*_EX\|-*.bak|-*.dwl|-*.dwl2|-*.txt|-*.skb"

highend
Posts: 13274
Joined: 06 Feb 2011 00:33

Re: Sync Script: Syntax error for filters to exclude certain folders

Post by highend »

Doesn't happen here and mine is still at the end of the filter definition...

Show a part of the source folder structure that contains an "_EX" folder.
Use a branch view for this.

I guess sync is broken. At least as I understand it.

If the files / folders aren't already in the destination folder, they aren't copied over when excluded.
But if they already exist because a filter was added after the first sync, they aren't deleted.
Target folder. The contents of this folder will be made identical to those of the source folder
One of my scripts helped you out? Please donate via Paypal

Emre
Posts: 24
Joined: 17 Feb 2016 07:14

Re: Sync Script: Syntax error for filters to exclude certain folders

Post by Emre »

Ok I'm posting a "censored" structure example here.
So many ex folders here.
structure_ex.jpg
structure_ex.jpg (48.85 KiB) Viewed 1438 times

I can live with sync not deleting previously synced folders.
Attachments
sync-del.jpg
sync-del.jpg (45.38 KiB) Viewed 1438 times

highend
Posts: 13274
Joined: 06 Feb 2011 00:33

Re: Sync Script: Syntax error for filters to exclude certain folders

Post by highend »

Src folder, it contains 2 _ex folders, one in the root and one under "ex_archive"
src.png
src.png (16.37 KiB) Viewed 1434 times
Dst was empty and after syncing
dst.png
dst.png (10.12 KiB) Viewed 1434 times
The log file states:

Code: Select all

Sync Folders from 11.12.2020 09:54:56

From: R:\tst\src\
To:   R:\tst\dst\

Filter: -*.bak|-*.dwl|-*.dwl2|-*.txt|-*.skb|-*_EX\

Files processed: 3 (3 new, 0 over, 0 skip), 2 dir, 0 del, 0 ren
Bytes copied:    0 bytes
Transfer rate:   290 files/sec
Created folders: 2
Remarks:         Sync Folders completed in 13,1 ms

------------------------------------------------------------------------

Processed files:

New  R:\tst\src\c.img -> R:\tst\dst\c.img
New  R:\tst\src\ex_archive\c.img -> R:\tst\dst\ex_archive\c.img
New  R:\tst\src\ex_archive\_exsync\c.img -> R:\tst\dst\ex_archive\_exsync\c.img

------------------------------------------------------------------------

Created folders:

CreateDir R:\tst\dst\ex_archive\
CreateDir R:\tst\dst\ex_archive\_exsync\
One of my scripts helped you out? Please donate via Paypal

Emre
Posts: 24
Joined: 17 Feb 2016 07:14

Re: Sync Script: Syntax error for filters to exclude certain folders

Post by Emre »

Well, I just added a log file to the script, just to see the results.

Somehow it works now :P. The is some kind of bug in sync, but I will not change the script, leave the logfile attribute there :D.

Code: Select all

sync "\\dc\Server\abc", "D:\OneDrive\xyz", 1, 0, 4, "c", "D:\xylog.txt", 7:="-*_EX\|-*.bak|-*.dwl|-*.dwl2|-*.txt|-*.skb";
Thanks for the help @highend.


EDIT: No it is unreliable, added the filter to my other backup script / not skipping EX folders.

jupe
Posts: 2757
Joined: 20 Oct 2017 21:14
Location: Win10 22H2 120dpi

Re: Sync Script: Syntax error for filters to exclude certain folders

Post by jupe »

FYI now you have added the log parameter, the 7:= should be superfluous, previously it could have been excluded if you had added a comma instead, which would have supplied the parameters in the required order, as documented in the help file.

Post Reply