Improved documentation for filter usage inside scripts
This commit is contained in:
@@ -92,6 +92,7 @@ namespace Duplicati.CommandLine
|
||||
tp = tp.Replace("%BACKENDS%", string.Join(", ", Library.DynamicLoader.BackendLoader.Keys));
|
||||
tp = tp.Replace("%MONO%", Library.Utility.Utility.IsMono ? "mono " : "");
|
||||
tp = tp.Replace("%APP_PATH%", System.IO.Path.GetFileName(System.Reflection.Assembly.GetExecutingAssembly().Location));
|
||||
tp = tp.Replace("%PATH_SEPARATOR%", System.IO.Path.PathSeparator.ToString());
|
||||
tp = tp.Replace("%EXAMPLE_SOURCE_PATH%", Library.Utility.Utility.IsClientLinux ? "/source" : "D:\\source");
|
||||
tp = tp.Replace("%EXAMPLE_SOURCE_FILE%", Library.Utility.Utility.IsClientLinux ? "/source/myfile.txt" : "D:\\source\\file.txt");
|
||||
tp = tp.Replace("%EXAMPLE_RESTORE_PATH%", Library.Utility.Utility.IsClientLinux ? "/restore" : "D:\\restore");
|
||||
|
||||
@@ -375,7 +375,7 @@ Duplicati can apply globbing and regex filter rules to backup and restore specif
|
||||
Regex: [.*test\.txt]
|
||||
|
||||
Inside scripts and the commandline --parameters-file, where multiple filters are supplied with a single option, filters must be prefixed with either a plus (+) or a (-), for include and exclude respectively. Example:
|
||||
+*.txt;-[.*\.xyz];+*
|
||||
+*.txt%PATH_SEPARATOR%-[.*\.xyz]%PATH_SEPARATOR%+*
|
||||
|
||||
|
||||
# =============================================================================
|
||||
|
||||
@@ -54,6 +54,21 @@ REM will be ignored:
|
||||
REM echo "Hello! -- test, this line is ignored"
|
||||
REM echo "--new-option=""This will be a setting"""
|
||||
|
||||
REM Filters are supplied in the DUPLICAT__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"
|
||||
|
||||
|
||||
REM ###############################################################################
|
||||
|
||||
@@ -54,6 +54,21 @@
|
||||
# echo "Hello! -- test, this line is ignored"
|
||||
# echo "--new-option=\"This will be a setting\""
|
||||
|
||||
# Filters are supplied in the DUPLICAT__FILTER variable.
|
||||
# The variable contains all filters supplied with --include and --exclude,
|
||||
# combined into a single string, separated with colon (:).
|
||||
# Filters set with --include will be prefixed with a plus (+),
|
||||
# and filters set with --exclude will be prefixed with a minus (-).
|
||||
#
|
||||
# Example:
|
||||
# --include=*.txt --exclude=[.*\.abc] --include=*
|
||||
#
|
||||
# Will be encoded as:
|
||||
# DUPLICATI__FILTER=+*.txt:-[.*\.abc]:+*
|
||||
#
|
||||
# You can set the filters by writing --filter=<new filter> to stdout.
|
||||
# You may want to append to the existing filter like this:
|
||||
# echo "--filter=+*.123:%DUPLICATI__FILTER%:-*.xyz"
|
||||
|
||||
|
||||
###############################################################################
|
||||
|
||||
Reference in New Issue
Block a user