4 4 3 Beefalo:Exclude with Regular Expressions: Difference between revisions

From SEPsesam
No edit summary
No edit summary
Line 8: Line 8:
{{<translate><!--T:56--> note</translate>|
{{<translate><!--T:56--> note</translate>|
*<translate><!--T:57--> When creating exclude lists with regex, pay attention to which SEP sesam version you are using. As of [[SEP sesam Release Versions|≥ Jaglion V2 SP1]] it is possible to use separate excludes for files and directories, which can help in creating more selective excludes.</translate>
*<translate><!--T:57--> When creating exclude lists with regex, pay attention to which SEP sesam version you are using. As of [[SEP sesam Release Versions|≥ Jaglion V2 SP1]] it is possible to use separate excludes for files and directories, which can help in creating more selective excludes.</translate>
**<translate><!--T:58--> If exclude ends with a trailing slash "<tt>/$</tt>" (e.g. <tt>/mnt/$</tt>), it is recognized as a regex for directory exclusion.</translate>
**<translate><!--T:58--> If exclude ends with a trailing slash "<tt>/$</tt>" (e.g. <tt>./mnt/$</tt>), it is recognized as a regex for directory exclusion.</translate>
**<translate><!--T:59--> If there is no trailing slash "<tt>/</tt>" (e.g. <tt>.tmp</tt>) at the end, it is recognized as a regex for file exclusion.</translate>
**<translate><!--T:59--> If there is no trailing slash "<tt>/</tt>" (e.g. <tt>.tmp</tt>) at the end, it is recognized as a regex for file exclusion.</translate>
*<translate> <!--T:62--> This new syntax caused the backup of folders to be ignored if the folder exclusion pattern was not adjusted. SEP has released a '''hotfix for Jaglion V2 SP1''' to revert to the old behavior. It also allows to explicitly set the new behavior with the <code>-o excl<nowiki>=</nowiki>regexp_split</code> option. The hotfix accepts the new syntax for folders (ending with <tt>/$</tt>)!</translate>}}
*<translate> <!--T:62--> This new syntax caused the backup of folders to be ignored if the folder exclusion pattern was not adjusted. SEP has released a '''hotfix for Jaglion V2 SP1''' to revert to the old behavior. It also allows to explicitly set the new behavior with the <code>-o excl<nowiki>=</nowiki>regexp_split</code> option. The hotfix accepts the new syntax for folders (ending with <tt>/$</tt>)!</translate>}}

Revision as of 09:55, 21 July 2022

Other languages:
<<<Back
Appendix
User Manual
Next>>>
Exclude with File Patterns


Exclude with Regular Expressions

Information sign.png Note
  • When creating exclude lists with regex, pay attention to which SEP sesam version you are using. As of ≥ Jaglion V2 SP1 it is possible to use separate excludes for files and directories, which can help in creating more selective excludes.
    • If exclude ends with a trailing slash "/$" (e.g. ./mnt/$), it is recognized as a regex for directory exclusion.
    • If there is no trailing slash "/" (e.g. .tmp) at the end, it is recognized as a regex for file exclusion.
  • This new syntax caused the backup of folders to be ignored if the folder exclusion pattern was not adjusted. SEP has released a hotfix for Jaglion V2 SP1 to revert to the old behavior. It also allows to explicitly set the new behavior with the -o excl=regexp_split option. The hotfix accepts the new syntax for folders (ending with /$)!

When creating a backup task in the GUI, you specify the source for your backup as well as define any files or patterns you want to exclude from the backup. Note that when the number of files to be excluded from the backup exceeds the allowed length for the exclude list, you should set up custom exclusions by adding files, file types or regular expressions in the Exclude list editor. On Windows, you can also use the option Pattern exclude (see Exclude with File Patterns); on Linux, it is only possible to exclude by using regular expressions (regex exclude). For more details, see Creating Exclude List.

SEP Tip.png Tip
The exclude list on the SEP sesam Linux Client can also be used as an include list by specifying the + (plus) sign at the beginning of a pattern. For details, see Advanced Backup and Restore Options.

The procedure for using regex exclude is SEP sesam version dependent. Make sure you use the correct regex exclude according to the version you are using.

Exclude with regex in ≥ Jaglion V2 SP1

As of ≥ 5.0.0.9 Jaglion V2 SP1, you can use separate excludes for files and directories. This means that you have to use the following form to specify whether the directory or a file is excluded.

  • If exclude ends with a trailing slash "/$" (e.g. .tmp/$), it is recognized as a regex for directory exclusion.
  • If there is no trailing slash "/" (e.g. .tmp) at the end, it is recognized as a regex for file exclusion.

Add the following switch to the backup options in the GUI for regex to distinguish between files and folders using ending "/$":

-o excl=regexp_split 

Examples for exclude list with regular expressions for ≥ 5.0.0.9 Jaglion V2 SP1:

  • Backing up /var without directory /var/tmp but with directory /var/tmp1:
  • \./var/tmp/$
  • Backing up /var without any directory */tmp*:
  • /tmp.*/$
  • Backing up directory /var without file /var/tmp but with directory /var/tmp:
  • \./var/tmp
  • Backing up source /usr avoiding *.o, *.tmp, a.out, old*.c files and all old* directories:
  • \.o$, \.tmp$, /a\.out$, /old.*\.c$, /old.*/$
  • Backing up /usr without /usr/var/spool and /usr/var/log files:
  • \./usr/var/spool$, \./usr/var/log$
  • Avoid all syslog####.log files:
  • /syslog[0-9]*.log$

For more regex examples, see RegExp: Examples for Excluding Matched Patterns.

Exclude with regex in ≤ Jaglion V2

When creating exclude lists with regex, pay attention to which SEP sesam version you are using. SEP sesam ≤ Jaglion V2 used the exclude syntax that did not allow separate excludes for files and directories.

  • If you are still using one of the older SEP sesam versions, you can use your existing exclude list as before.
  • Once you upgrade to ≥ Jaglion V2 SP1, you can use your existing exclude list or decide to customize your exclude lists to use the new syntax for separate excludes for files and directories (ending with /$). In this case, you have to add the following switch to the backup options in the GUI to distinguish between files and folders using ending "/$": -o excl=regexp_split.

Examples

  • Backing up /var without /var/tmp but with file or directory /var/tmp1:
 \./var/tmp$
  • Backing up /var without any file or directory */tmp*:
 /tmp
  • Backing up source /usr avoiding *.o, *.tmp, a.out, old*.c and old* files and directories:
 \.o$, \.tmp$, /a\.out$, /old.*\.c$, /old.*$

  • Backing up /usr without /usr/var/spool and /usr/var/log:
 \./usr/var/spool$, \./usr/var/log$
  • Avoid all syslog####.log files and directories:
 /syslog[0-9]*.log$

For more RegExp examples, see RegExp: Examples for Excluding Matched Patterns.


See also

Creating Exclude ListRegExp: Examples for Excluding Matched Patterns


Copyright © SEP AG 1999-2024. All rights reserved.

Any form of reproduction of the contents or parts of this manual is allowed only with the express written permission from SEP AG. When compiling and designing user documentation SEP AG uses great diligence and attempts to deliver accurate and correct information. However, SEP AG cannot issue a guarantee for the contents of this manual.