|
|||
|
Excluding Files When Using rdiff-backup A wide variety of command-line options allows you to control which files are included in the backup process. Here are the ones more commonly used: –exclude pattern: Files matching the pattern should be excluded. Matching directories, and their contents, will be excluded. –exclude-device-files: Causes all device files to be ignored. –exclude-filelist filename: All files listed in the file filename are excluded from the backup operation. –exclude-filelist-stdin: A list of files can be sent in through stdin. These files will be excluded. –exclude-other-filesystems: Only files on the same physical filesystem as the base source directory are backed up. –exclude-regexp regex: Files matching the regular expression will be excluded. Python-style regular expressions are used. Files within matching directories are processed separately. –include pattern: Files matching the pattern should be included. Matching directories, and their contents, will also be included. –include-filelist filename: Only files listed in the file filename are included in the backup operation. –include-filelist-stdin: A list of files can be sent in through stdin. Only files found in this list will be part of the backup. –include-regexp regex: Files matching the regular expression will be included. Python-style regular expressions are used. Files within matching directories are processed separately. Regardless of the number of these options specified, each rule is applied to each file. The first rule that matches the file determines its fate. If no rule matches, the default action is to include the file. For instance, let's say that you want to back up the /var/ directory, except for the /var/spool/ directory, but you do want /var/spool/mail/. You can do this: rdiff-backup --include /var/spool/mail --exclude /var/spool /var /backup A file pattern (used by the –include and –exclude options) can contain the standard shell globbing characters (*, +, and []). Neither * nor + can match a /; this is important since the full pathname of each file is compared. The special sequence **, however, does match any number of characters, including forward slashes. The pattern can start with the string ignorecase: to—you guessed it—make the pattern case-insensitive. Be sure to quote these patterns so that the shell doesn't interpret them before rdiff-backup gets a chance at them. |
![]() |
| Bookmarks |
| Tags |
| backup, excluding files, rdiff, rdiff-backup, unix |
| Thread Tools | |
| Display Modes | |
|
|