Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ability to use DUPLICATI__FILTER in after script #5143

Open
avmaksimov opened this issue Apr 7, 2024 · 2 comments
Open

Add ability to use DUPLICATI__FILTER in after script #5143

avmaksimov opened this issue Apr 7, 2024 · 2 comments

Comments

@avmaksimov
Copy link

Now it's possible only in before script.

I need it as I want to backup this filters.

@ts678
Copy link
Collaborator

ts678 commented Apr 7, 2024

Forum discussion is here. It's not clear if this was an oversight.
A casual reading of the example script (ignoring context) would make one think it should be in both scripts, as is LOCALPATH.

REM Filters are supplied in the DUPLICATI__FILTER variable.
REM The variable contains all filters supplied with --include and --exclude,
REM combined into a single string, separated with semicolon (;).
REM Filters set with --include will be prefixed with a plus (+),
REM and filters set with --exclude will be prefixed with a minus (-).
REM
REM Example:
REM --include=*.txt --exclude=[.*\.abc] --include=*
REM
REM Will be encoded as:
REM DUPLICATI__FILTER=+*.txt;-[.*\.abc];+*
REM
REM You can set the filters by writing --filter=<new filter> to stdout.
REM You may want to append to the existing filter like this:
REM echo "--filter=+*.123;%DUPLICATI__FILTER%;-*.xyz"

I need it as I want to backup this filters.

Workaround can get it in the before script.

@Jojo-1000
Copy link
Contributor

The cause is that a special "filter" option is created before calling the modules, to allow them to change the filters. Before running the backup, it is removed to prevent side-effects.

// Make the filter read-n-write able in the generic modules
var pristinefilter = string.Join(System.IO.Path.PathSeparator.ToString(), FilterExpression.Serialize(filter));
m_options.RawOptions["filter"] = pristinefilter;

To get the information back in the after script, this would need to be repeated. Probably noone saw the need for that

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants