How do you use TheBestPessimist/duplicacy-utils/symlink-filters file as i want to change it?




Long story but i got a new computer and i though of using the symlink backup style a little differently.
The issue is that this new style requires changing the symlink regex quite a bit so i want to know how are you using my symlink filters file to decide how to continue!

You know that i work @ GitHub - TheBestPessimist/duplicacy-utils: Utilities for Windows for Duplicacy, which contains both a powershell script and also 2 variants for the filters file for symlink and non-symlink.

@NiJoao , @Christoph and other users of my filters, I need your input on this one!

Right now i have the following computer layout (the new version):

PS C:\duplicacy repositories\tbp-nuc> dir

    Directory: C:\duplicacy repositories\tbp-nuc

Mode                LastWriteTime         Length Name
----                -------------         ------ ----
d-----        12-Dec-18     20:39                .duplicacy
d----l        12-Dec-18     19:37                C__all_link
d----l        12-Dec-18     19:38                C__Users_link
-a----        12-Dec-18     18:26       26002432 z.exe

Basically I have a repository in a specific folder which has 2 symlinks: one for my c:/Users/ folder and another to a different folder.

Let’s take a regex example from issue NetHood, PrintHood, etc. · Issue #20 · TheBestPessimist/duplicacy-utils · GitHub :

  • Original: e:(?i)^[^/]+/Users/[^/]+/\.?NetHood

  • Proposal: e:(?i)^[^/]*Users[^/]*/[^/]+/\.?NetHood

(note that i omitted the last / since it is wrong, that will be fixed disregarding what comes out of this discussion)

You can see that in my new layout the NetHood folder is included:
2018-12-29 17:34:31.868 DEBUG PATTERN_INCLUDE C__Users_link/Default/NetHood is included
as the folder structure is \users symlink\myuser\NetHood instead of \asymlink\users\myuser\NetHood.

With my proposal (which looks a bit dirty and difficult), the normal pattern will not work anymore.

  1. What do you think about the proposed regex change?

  2. How do you use symlinks? Do you just symlink the whole “c” directory like i did up until now? Right now i don’t wanna symlink the whole of it anymore.

  3. A third question would be: should i add the new version along the old one? just have something like

e:(?i)^[^/]+/Users/[^/]+/\.?NetHood               <- this is the old version
e:(?i)^[^/]*Users[^/]*/[^/]+/\.?NetHood           <- this is the new one

and during backup see what sticks matches?


Hi @TheBestPessimist,
Sorry for the delay.
I see some problems with your proposal, but I also present a nice and simple solution at the end:

  1. Heavy:

I would prefer having multiple very lightweight filters files than a single large one.
Regex is not very easy on the CPU side…

  1. Lack of reliability:

The original script was meant to be used “symlinking” to root drive, providing us a guarantee the excluded folders are the ones we know are useless. Deviating from the standard system names looses this guarantee.

  1. Harder to understand:

Your proposal only works if there is “Users” in the name of the symlink pointing to “c:/Users/”. This is acceptable, but should be documented and will result in “issues” being launched by users, for sure.

  1. Duplicated solution:

You (We?) already maintain (?) filters files for symlink-mode and root-mode.
The difference is “symlink-mode” expects one (or more) symlinks to root drives containing all typical “system” folders, while “root-mode” expects those “typical system folders” to be the first ones in the path (repo? These names confuse me…).

I think you can easily do what you want with the root-mode filter file:
Hint: There is no difference for duplicacy between the following path/repo structures:

C:\           (repo)
 |-- Users\
 |-- Programs\
 \-- Windows\


C:\duplicacy repositories\tbp-nuc\           (repo)
 |-- Users     => C:\Users\
 |-- Programs  => C:\Programs\
 \-- Windows   => C:\Windows\

(Lie: There is a small difference. I think the files being parsed are “/Users/files…” vs “Users/files…”, but the root-mode filters file ignores the first character if it’s a “/”.)

Therefore, my proposal:
Name you symlinks exactly what they are pointing to;
Use the root-mode filters file;
Test this solution;
Keep maintaining only 2 lightweight filters files;
Nice to have: Perform the “Explanare level 10 spell” and document this use-case so others can use it.