Table of ContentsView in Frames

Excluding specified files and directories

You can exclude a list of files and directories from a backup. You can also specify a pattern based on which you can exclude files and directories from a backup. For example, you can exclude the files that end with .core.

About this task

The rules for constructing a string for excluding files are as follows:

  • A string can be a file name.
  • You can use the asterisk (*) as a wildcard character.
  • The wildcard character must be the first or last character of the string. Each string can contain up to two wildcard characters. For example, you can specify *.core, core.*, or *core.*, but not core*.1.
  • If you have more than one string, you must separate the strings with a comma.
  • You cannot have a comma in the file name or pattern.
  • You can specify up to 32 strings.

Steps

  1. To exclude files from a backup, use the X option in the command line.
  2. Include a string or comma-separated list of strings as a parameter for the X option.

Example

The following command performs a level-0 backup of the /vol/vol1 volume, but excludes the files that meet certain requirements:

dump 0ufX rst0a tmp,*.o,core*,*backup*, /vol/vol1

The following list describes the elements of the command line:
0
Does a full backup.
u
Records the backup in the /etc/dumpdates file.
f
Specifies that a tape device is supplied in the command line.
X
Specifies that an exclude list is specified.
rst0a
The tape drive rewinds the tape.
tmp,*.o,core*,*backup*
The exclude list specifies files as follows:
  • tmp specifies that the file name is tmp.
  • *.o specifies that the file name ends in .o (for example, program.o).
  • core* specifies that the file name begins with the core string (for example, core.small).
  • *backup* specifies that the file name contains the backup string (for example, spec.backup.1).
/vol/vol1
The volume to be backed up.