--%
-%%
-
\section{The FileSet Resource}
\label{FileSetResource}
\index[general]{Resource!FileSet}
Bacula will ensure that the next backup is always a Full save.
Bacula is designed to handle most character sets of the world,
-US ASCII, German, French, Chinese, ... However, it does this by
+US ASCII, German, French, Chinese, \ldots{} However, it does this by
encoding everything in UTF-8, and it expects all configuration files
(including those read on Win32 machines) to be in UTF-8 format.
UTF-8 is typically the default on Linux machines, but not on all
Unix machines, nor on Windows, so you must take some care to ensure
-that your locale is set properly before starting Bacula.
+that your locale is set properly before starting Bacula.
On most modern Win32 machines, you can edit the conf files with {\bf
notebook} and choose output encoding UTF-8.
To ensure that Bacula configuration files can be correctly read including
-foreign characters the {bf LANG} environment variable
-must end in {\bf .UTF-8}. An full example is {\bf en\_US.UTF-8}. The
+foreign characters the {\bf LANG} environment variable
+must end in {\bf .UTF-8}. A full example is {\bf en\_US.UTF-8}. The
exact syntax may vary a bit from OS to OS, and exactly how you define
it will also vary.
Start of the FileSet resource. One {\bf FileSet} resource must be
defined for each Backup job.
+\label{Director:Fileset:Name}
\item [Name = \lt{}name\gt{}]
\index[dir]{Name}
\index[dir]{Directive!Name}
- The name of the FileSet resource. This directive is required.
+ The name of the FileSet resource. This directive is required.
+\label{Director:Fileset:IgnoreFilesetChanges}
\item [Ignore FileSet Changes = \lt{}yes\vb{}no\gt{}]
\index[dir]{Ignore FileSet Changes}
\index[dir]{Directive!Ignore FileSet Changes}
the next backup will be forced to a Full so that Bacula can
guarantee that any additions or deletions are properly saved.
- We strongly recommend against setting this directive to yes,
+ We strongly recommend against setting this directive to yes,
since doing so may cause you to have an incomplete set of backups.
If this directive is set to {\bf yes}, any changes you make to the
- FileSet Include or Exclude lists, will not force a Full during
+ FileSet Include or Exclude lists, will not force a Full during
subsequent backups.
The default is {\bf no}, in which case, if you change the Include or
Exclude, Bacula will force a Full backup to ensure that everything is
properly backed up.
+\label{Director:Fileset:EnableVss}
\item [Enable VSS = \lt{}yes\vb{}no\gt{}]
\index[dir]{Enable VSS}
\index[dir]{Directive!Enable VSS}
of open files to be made for cooperating writer applications, and for
applications that are not VSS away, Bacula can at least copy open files.
The Volume Shadow Copy will only be done on Windows drives where the
- drive (e.g. C:, D:, ...) is explicitly mentioned in a {\bf File}
+ drive (e.g. C:, D:, \ldots{}) is explicitly mentioned in a {\bf File}
directive.
For more information, please see the
\ilink{Windows}{VSS} chapter of this manual.
-
-\item [Include \{ Options \{\lt{}file-options\gt{}\} ...;
+\label{Director:Fileset:Include}
+\item [Include \{ Options \{\lt{}file-options\gt{}\} \ldots{};
\lt{}file-list\gt{} \} ]
-\index[dir]{Include \{ [ Options \{\lt{}file-options\gt{}\} ...]
+\index[dir]{Include \{ [ Options \{\lt{}file-options\gt{}\} \ldots{}]
\lt{}file-list\gt{} \} }
\index[dir]{Directive!Include}
\item [Options \{ \lt{}file-options\gt{} \} ]
\index[dir]{Options \{ \lt{}file-options\gt{} \} }
+\label{Director:Fileset:Exclude}
\item [Exclude \{ \lt{}file-list\gt{} \}]
\index[dir]{Exclude \{ \lt{}file-list\gt{} \} }
\index[dir]{Directive!Exclude}
-
+\label{Director:Fileset:End}
\end{description}
The Include resource must contain a list of directories and/or files to be
consists of one file or directory name per line. Directory names should be
specified without a trailing slash with Unix path notation.
-Windows users, please take note to specify directories (even c:/...) in
+Windows users, please take note to specify directories (even c:/\ldots{}) in
Unix path notation. If you use Windows conventions, you will most likely
not be able to restore your files due to the fact that the Windows
path separator was defined as an escape character long before Windows
only the root partition and not any of the other mounted filesystems.
Similarly on Windows systems, you must explicitly specify each of the
drives you want saved (e.g.
-{\bf c:/} and {\bf d:/} ...). In addition, at least for Windows systems, you
+{\bf c:/} and {\bf d:/} \ldots{}). In addition, at least for Windows systems, you
will most likely want to enclose each specification within double quotes
particularly if the directory (or file) name contains spaces. The {\bf df}
command on Unix systems will show you which mount points you must specify to
-save everything. See below for an example.
+save everything. See below for an example.
Take special care not to include a directory twice or Bacula will backup
the same files two times wasting a lot of space on your archive device.
Including a directory twice is very easy to do. For example:
\footnotesize
-\begin{verbatim}
+\begin{lstlisting}
Include {
Options { compression=GZIP }
File = /
File = /usr
}
-\end{verbatim}
+\end{lstlisting}
\normalsize
on a Unix system where /usr is a subdirectory (rather than a mounted
filesystem) will cause /usr to be backed up twice.
-Please take note of the following items in the FileSet syntax:
+Please take note of the following items in the FileSet syntax:
\begin{enumerate}
\item There is no equal sign (=) after the Include and before the opening
- brace (\{). The same is true for the Exclude.
+ brace (\{). The same is true for the Exclude.
\item Each directory (or filename) to be included or excluded is preceded by a {\bf File
- =}. Previously they were simply listed on separate lines.
+ =}. Previously they were simply listed on separate lines.
\item The options that previously appeared on the Include line now must be
specified within their own Options resource.
-\item The Exclude resource does not accept Options.
+\item The Exclude resource does not accept Options.
\item When using wild-cards or regular expressions, directory names are
always terminated with a slash (/) and filenames have no trailing slash.
\end{enumerate}
The Options resource is optional, but when specified, it will contain a
list of {\bf keyword=value} options to be applied to the file-list.
-See below for the definition of file-list.
+See below for the definition of file-list.
Multiple Options resources may be specified one after another. As the
files are found in the specified directories, the Options will applied to
the filenames to determine if and how the file should be backed up. The
It is a good idea to put all your wild-card and regex expressions inside
double quotes to prevent conf file scanning problems.
-This is perhaps a bit overwhelming, so there are a number of examples included
+This is perhaps a bit overwhelming, so there are a number of examples included
below to illustrate how this works.
You find yourself using a lot of Regex statements, which will cost quite a lot
of CPU time, we recommend you simplify them if you can, or better yet
convert them to Wild statements which are much more efficient.
-The directives within an Options resource may be one of the following:
+The directives within an Options resource may be one of the following:
\begin{description}
or the SHA1 option be specified as a default for all files.
-\item[basejob=\lt{}options\gt{}]
+\item[basejob=\lt{}options\gt{}]
\index[dir]{basejob}
\index[dir]{Directive!basejob}
with BaseJobs. The options letters are the same than in the \textbf{verify=}
option below.
-\item[accurate=\lt{}options\gt{}]
+\item[accurate=\lt{}options\gt{}]
\index[dir]{accurate}
\index[dir]{Directive!accurate}
The options letters specified are used when running a {\bf Backup
Level=Incremental/Differential} in Accurate mode. The options
- letters are the same than in the \textbf{verify=} option below.
+ letters are the same than in the \textbf{verify=} option below.
\item [verify=\lt{}options\gt{}]
\index[dir]{verify}
\index[dir]{Directive!verify}
The options letters specified are used when running a {\bf Verify
Level=Catalog} as well as the {\bf DiskToCatalog} level job. The options
- letters may be any combination of the following:
+ letters may be any combination of the following:
\begin{description}
\item {\bf i}
- compare the inodes
+ compare the inodes
\item {\bf p}
- compare the permission bits
+ compare the permission bits
\item {\bf n}
- compare the number of links
+ compare the number of links
\item {\bf u}
- compare the user id
+ compare the user id
\item {\bf g}
- compare the group id
+ compare the group id
\item {\bf s}
- compare the size
+ compare the size
\item {\bf a}
- compare the access time
+ compare the access time
\item {\bf m}
- compare the modification time (st\_mtime)
+ compare the modification time (st\_mtime)
\item {\bf c}
- compare the change time (st\_ctime)
+ compare the change time (st\_ctime)
\item {\bf d}
- report file size decreases
+ report file size decreases
\item {\bf 5}
- compare the MD5 signature
+ compare the MD5 signature
\item {\bf 1}
- compare the SHA1 signature
+ compare the SHA1 signature
\end{description}
A useful set of general options on the {\bf Level=Catalog} or {\bf
Level=DiskToCatalog} verify is {\bf pins5} i.e. compare permission bits,
- inodes, number of links, size, and MD5 changes.
+ inodes, number of links, size, and MD5 changes.
\item [onefs=yes\vb{}no]
\index[dir]{onefs}
file system. That is it will not backup file systems that are mounted
on a subdirectory. If you are using a *nix system, you may not even be
aware that there are several different filesystems as they are often
- automatically mounted by the OS (e.g. /dev, /net, /sys, /proc, ...).
+ automatically mounted by the OS (e.g. /dev, /net, /sys, /proc, \ldots{}).
With Bacula 1.38.0 or later, it will inform you when it decides not to
traverse into another filesystem. This can be very useful if you forgot
to backup a particular partition. An example of the informational
message in the job report is:
\footnotesize
-\begin{verbatim}
+\begin{lstlisting}
rufus-fd: /misc is a different filesystem. Will not descend from / into /misc
rufus-fd: /net is a different filesystem. Will not descend from / into /net
rufus-fd: /var/lib/nfs/rpc_pipefs is a different filesystem. Will not descend from /var/lib/nfs into /var/lib/nfs/rpc_pipefs
rufus-fd: /sys is a different filesystem. Will not descend from / into /sys
rufus-fd: /dev is a different filesystem. Will not descend from / into /dev
rufus-fd: /home is a different filesystem. Will not descend from / into /home
-\end{verbatim}
+\end{lstlisting}
\normalsize
- Note: in previous versions of Bacula, the above message was of the form:
+ Note: in previous versions of Bacula, the above message was of the form:
\footnotesize
-\begin{verbatim}
+\begin{lstlisting}
Filesystem change prohibited. Will not descend into /misc
-\end{verbatim}
+\end{lstlisting}
\normalsize
If you wish to backup multiple filesystems, you can explicitly
also be backed up. Normally, it is preferable to set {\bf onefs=yes} and to
explicitly name each filesystem you want backed up. Explicitly naming the
filesystems you want backed up avoids the possibility of getting into a
- infinite loop recursing filesystems. Another possibility is to
- use {\bf onefs=no} and to set {\bf fstype=ext2, ...}.
- See the example below for more details.
+ infinite loop recursing filesystems. Another possibility is to
+ use {\bf onefs=no} and to set {\bf fstype=ext2, \ldots{}}.
+ See the example below for more details.
If you think that Bacula should be backing up a particular directory
and it is not, and you have {\bf onefs=no} set, before you complain,
please do:
\footnotesize
-\begin{verbatim}
+\begin{lstlisting}
stat /
stat <filesystem>
-\end{verbatim}
+\end{lstlisting}
\normalsize
-where you replace {\bf filesystem} with the one in question. If the
+where you replace {\bf filesystem} with the one in question. If the
{\bf Device:} number is different for / and for your filesystem, then they
are on different filesystems. E.g.
\footnotesize
-\begin{verbatim}
+\begin{lstlisting}
stat /
File: `/'
Size: 4096 Blocks: 16 IO Block: 4096 directory
Access: 2005-11-10 12:28:02.000000000 +0100
Modify: 2005-11-06 12:36:48.000000000 +0100
Change: 2005-11-06 12:36:48.000000000 +0100
-\end{verbatim}
+\end{lstlisting}
\normalsize
Also be aware that even if you include {\bf /home} in your list
of files to backup, as you most likely should, you will get the
- informational message that "/home is a different filesystem" when
+ informational message that "/home is a different filesystem" when
Bacula is processing the {\bf /} directory. This message does not
- indicate an error. This message means that while examining the
- {\bf File =} referred to in the second part of the message, Bacula will
+ indicate an error. This message means that while examining the
+ {\bf File =} referred to in the second part of the message, Bacula will
not descend into the directory mentioned in the first part of the message.
- However, it is possible that the separate filesystem will be backed up
+ However, it is possible that the separate filesystem will be backed up
despite the message. For example, consider the following FileSet:
\footnotesize
-\begin{verbatim}
+\begin{lstlisting}
File = /
File = /var
-\end{verbatim}
+\end{lstlisting}
\normalsize
where {\bf /var} is a separate filesystem. In this example, you will get a
- message saying that Bacula will not decend from {\bf /} into {\bf /var}. But
- it is important to realise that Bacula will descend into {\bf /var} from the
+ message saying that Bacula will not decend from {\bf /} into {\bf /var}. But
+ it is important to realise that Bacula will descend into {\bf /var} from the
second File directive shown above. In effect, the warning is bogus,
- but it is supplied to alert you to possible omissions from your FileSet. In
- this example, {\bf /var} will be backed up. If you changed the FileSet such
+ but it is supplied to alert you to possible omissions from your FileSet. In
+ this example, {\bf /var} will be backed up. If you changed the FileSet such
that it did not specify {\bf /var}, then {\bf /var} will not be backed up.
-
+
\item [honor nodump flag=\lt{}yes\vb{}no\gt{}]
\index[dir]{honornodumpflag}
\index[dir]{Directive!honornodumpflag}
directory entry for the FIFO.
Unfortunately, when Bacula runs a RunBeforeJob, it waits until that
- script terminates, and if the script accesses the FIFO to write
+ script terminates, and if the script accesses the FIFO to write
into the it, the Bacula job will block and everything will stall.
- However, Vladimir Stavrinov as supplied tip that allows this feature
+ However, Vladimir Stavrinov as supplied tip that allows this feature
to work correctly. He simply adds the following to the beginning
of the RunBeforeJob script:
-\begin{verbatim}
+\begin{lstlisting}
exec > /dev/null
-\end{verbatim}
+\end{lstlisting}
\item [noatime=yes\vb{}no]
\index[dir]{noatime}
\item [checkfilechanges=yes\vb{}no]
\index[dir]{checkfilechanges}
\index[dir]{Directive!checkfilechanges}
- On versions 2.0.4 or greater,
- if enabled, the Client will check size, age of each file after
- their backup to see if they have changed during backup. If time
+ On versions 2.0.4 or greater,
+ if enabled, the Client will check size, age of each file after
+ their backup to see if they have changed during backup. If time
or size mismatch, an error will raise.
-\begin{verbatim}
+\begin{lstlisting}
zog-fd: Client1.2007-03-31_09.46.21 Error: /tmp/test mtime changed during backup.
-\end{verbatim}
+\end{lstlisting}
In general, it is recommended to use this option.
\item [hardlinks=yes\vb{}no]
\index[dir]{hardlinks}
\index[dir]{Directive!hardlinks}
- When enabled (default), this directive will cause hard links to be
+ When enabled (default), this directive will cause hard links to be
backed up. However, the File daemon keeps track of hard linked files and
- will backup the data only once. The process of keeping track of the
+ will backup the data only once. The process of keeping track of the
hard links can be quite expensive if you have lots of them (tens of
thousands or more). This doesn't occur on normal Unix systems, but if
you use a program like BackupPC, it can create hundreds of thousands, or
You may want to test your expressions prior to running your
backup by using the bwild program. Please see the
- \ilink{Utilities}{bwild} chapter of this manual for
- more. You can also test your full FileSet definition by using
- the \ilink{estimate}{estimate} command in the Console
- chapter of this manual.
+ \bsysxrlink{Utilities}{bwild}{utility}{chapter} of the \utilityman{} for
+ more information. You can also test your full FileSet definition by using
+ the \bsysxrlink{estimate}{estimate}{console}{command} in the \consoleman{}.
It is recommended to enclose the string in double quotes.
\item [wilddir=\lt{}string\gt{}]
You may want to test your expressions prior to running your
backup by using the bwild program. Please see the
- \ilink{Utilities}{bwild} chapter of this manual for
- more. You can also test your full FileSet definition by using
- the \ilink{estimate}{estimate} command in the Console
- chapter of this manual.
- An example of excluding with the WildDir option on Win32 machines is
+ \bsysxrlink{Utilities}{bwild}{utility}{chapter} of the \utilityman{} for
+ more information. You can also test your full FileSet definition by using
+ the \bsysxrlink{estimate}{estimate}{console}{command} in the \consoleman{}.
+ An example of excluding with the WildDir option on Win32 machines is
presented below.
\item [wildfile=\lt{}string\gt{}]
You may want to test your expressions prior to running your
backup by using the bwild program. Please see the
- \ilink{Utilities}{bwild} chapter of this manual for
- more. You can also test your full FileSet definition by using
- the \ilink{estimate}{estimate} command in the Console
- chapter of this manual.
- An example of excluding with the WildFile option on Win32 machines is
+ \bsysxrlink{Utilities}{bwild}{utility}{chapter} of the \utilityman{} for
+ more information. You can also test your full FileSet definition by using
+ the \bsysxrlink{estimate}{estimate}{console}{command} in the \consoleman{}.
+ An example of excluding with the WildFile option on Win32 machines is
presented below.
another, and in addition, regular expressions are complicated,
so you may want to test your expressions prior to running your
backup by using the bregex program. Please see the
- \ilink{Utilities}{bwild} chapter of this manual for
- more. You can also test your full FileSet definition by using
- the \ilink{estimate}{estimate} command in the Console
- chapter of this manual.
+ \bsysxrlink{Utilities}{bwild}{utility}{chapter} of the \utilityman{} for
+ more information. You can also test your full FileSet definition by using
+ the \bsysxrlink{estimate}{estimate}{console}{command} in the \consoleman{}.
+
- You find yourself using a lot of Regex statements, which will cost quite a lot
- of CPU time, we recommend you simplify them if you can, or better yet
+ You find yourself using a lot of Regex statements, which will cost quite a
+ lot of CPU time, we recommend you simplify them if you can, or better yet
convert them to Wild statements which are much more efficient.
\index[dir]{regexfile}
\index[dir]{Directive!regexfile}
Specifies a POSIX extended regular expression to be applied to
- non-directories. No directories will be matched by this directive.
+ non-directories. No directories will be matched by this directive.
However, note that the match is done against the full path and
filename, so your regex string must take into account that filenames
are preceded by the full path.
another, and in addition, regular expressions are complicated,
so you may want to test your expressions prior to running your
backup by using the bregex program. Please see the
- \ilink{Utilities}{bregex} chapter of this manual for
- more.
+ \bsysxrlink{bregex}{bregex}{utility}{command} of the \utilityman{} more.
\item [regexdir=\lt{}string\gt{}]
another, and in addition, regular expressions are complicated,
so you may want to test your expressions prior to running your
backup by using the bregex program. Please see the
- \ilink{Utilities}{bregex} chapter of this manual for
- more.
+ \bsysxrlink{bregex}{bregex}{utility}{command} of the \utilityman{} more.
\item [exclude=yes\vb{}no]
\index[dir]{aclsupport}
\index[dir]{Directive!aclsupport}
The default is {\bf no}. If this option is set to yes, and you have the
- POSIX {\bf libacl} installed on your system, Bacula will backup the file
- and directory UNIX Access Control Lists (ACL) as defined in IEEE Std
+ POSIX {\bf libacl} installed on your Linux system, Bacula will backup the
+ file and directory Unix Access Control Lists (ACL) as defined in IEEE Std
1003.1e draft 17 and "POSIX.1e" (abandoned). This feature is
- available on UNIX only and depends on the ACL library. Bacula is
+ available on Unix systems only and requires the Linux ACL library. Bacula is
automatically compiled with ACL support if the {\bf libacl} library is
- installed on your system (shown in config.out). While restoring the
+ installed on your Linux system (shown in config.out). While restoring the
files Bacula will try to restore the ACLs, if there is no ACL support
available on the system, Bacula restores the files and directories but
not the ACL information. Please note, if you backup an EXT3 or XFS
filesystem with ACLs, then you restore them to a different filesystem
(perhaps reiserfs) that does not have ACLs, the ACLs will be ignored.
+ For other operating systems there is support for either POSIX ACLs or
+ the more extensible NFSv4 ACLs.
+
+ The ACL stream format between Operation Systems is \textbf{not}
+ compatible so for example an ACL saved on Linux cannot be restored on
+ Solaris.
+
+ The following Operating Systems are currently supported:
+
+ \begin{enumerate}
+ \item AIX (pre-5.3 (POSIX) and post 5.3 (POSIX and NFSv4) ACLs)
+ \item Darwin
+ \item FreeBSD (POSIX and NFSv4/ZFS ACLs)
+ \item HPUX
+ \item IRIX
+ \item Linux
+ \item Solaris (POSIX and NFSv4/ZFS ACLs)
+ \item Tru64
+ \end{enumerate}
+
+\label{XattrSupport}
+\item [xattrsupport=yes\vb{}no]
+\index[dir]{xattrsupport}
+\index[dir]{Directive!xattrsupport}
+ The default is {\bf no}. If this option is set to yes, and your
+ operating system support either so called Extended Attributes or
+ Extensible Attributes Bacula will backup the file and directory
+ XATTR data. This feature is available on UNIX only and depends on
+ support of some specific library calls in libc.
+
+ The XATTR stream format between Operating Systems is {\bf not}
+ compatible so an XATTR saved on Linux cannot for example be restored
+ on Solaris.
+
+ On some operating systems ACLs are also stored as Extended Attributes
+ (Linux, Darwin, FreeBSD) Bacula checks if you have the aclsupport
+ option enabled and if so will not save the same info when saving
+ extended attribute information. Thus ACLs are only saved once.
+
+ The following Operating Systems are currently supported:
+
+ \begin{enumerate}
+ \item AIX (Extended Attributes)
+ \item Darwin (Extended Attributes)
+ \item FreeBSD (Extended Attributes)
+ \item IRIX (Extended Attributes)
+ \item Linux (Extended Attributes)
+ \item NetBSD (Extended Attributes)
+ \item Solaris (Extended Attributes and Extensible Attributes)
+ \item Tru64 (Extended Attributes)
+ \end{enumerate}
+
\item [ignore case=yes\vb{}no]
\index[dir]{ignore case}
\index[dir]{Directive!ignore case}
\item [hfsplussupport=yes\vb{}no]
\index[dir]{hfsplussupport}
\index[dir]{Directive!hfsplussupport}
- This option allows you to turn on support for Mac OSX HFS plus
+ This option allows you to turn on support for Mac OSX HFS plus
finder information.
\item [strippath=\lt{}integer\gt{}]
in file-lists. They can only be specified in Options resources.
There are a number of special cases when specifying directories and files in a
-{\bf file-list}. They are:
+{\bf file-list}. They are:
-\begin{itemize}
+\begin{bsysitemize}
\item Any name preceded by an at-sign (@) is assumed to be the name of a
file, which contains a list of files each preceded by a "File =". The
named file is read once when the configuration file is parsed during the
specified in the conf file. For example:
\footnotesize
-\begin{verbatim}
+\begin{lstlisting}
Include {
Options { compression=GZIP }
@/home/files/my-files
}
-\end{verbatim}
+\end{lstlisting}
\normalsize
\item Any name beginning with a vertical bar (\vb) is assumed to be the name of
a program. This program will be executed on the Director's machine at
the time the Job starts (not when the Director reads the configuration
file), and any output from that program will be assumed to be a list of
- files or directories, one per line, to be included. Before submitting the
- specified command bacula will performe
+ files or directories, one per line, to be included. Before submitting the
+ specified command bacula will performe
\ilink{character substitution}{character substitution}.
This allows you to have a job that, for example, includes all the local
examples below show you how to do this. However, please note two
things: \\
1. if you want the local filesystems, you probably should be
- using the new {\bf fstype} directive, which was added in version 1.36.3
+ using the new {\bf fstype} directive, which was added in version 1.36.3
and set {\bf onefs=no}.
\\
{\bf sh -c} will not be necessary providing the first line of the file
is {\bf \#!/bin/sh}.
- As an example:
+ As an example:
\footnotesize
-\begin{verbatim}
-
+\begin{lstlisting}
+
Include {
Options { signature = SHA1 }
File = "|sh -c 'df -l | grep \"^/dev/hd[ab]\" | grep -v \".*/tmp\" \
| awk \"{print \\$6}\"'"
}
-\end{verbatim}
+\end{lstlisting}
\normalsize
will produce a list of all the local partitions on a Red Hat Linux system.
- Note, the above line was split, but should normally be written on one line.
+ Note, the above line was split, but should normally be written on one line.
Quoting is a real problem because you must quote for Bacula which consists of
- preceding every \textbackslash{} and every " with a \textbackslash{}, and
+ preceding every \textbackslash{} and every " with a \textbackslash{}, and
you must also quote for the shell command. In the end, it is probably easier
- just to execute a small file with:
+ just to execute a small file with:
\footnotesize
-\begin{verbatim}
+\begin{lstlisting}
Include {
Options {
signature=MD5
}
File = "|my_partitions"
}
-\end{verbatim}
+\end{lstlisting}
\normalsize
- where my\_partitions has:
+ where my\_partitions has:
\footnotesize
-\begin{verbatim}
+\begin{lstlisting}
#!/bin/sh
df -l | grep "^/dev/hd[ab]" | grep -v ".*/tmp" \
| awk "{print \$6}"
-\end{verbatim}
+\end{lstlisting}
\normalsize
- If the vertical bar (\verb+|+) in front of my\_partitions is preceded by a
- backslash as in \textbackslash{}\verb+|+, the program will be executed on the
+ If the vertical bar (\lstinline+|+) in front of my\_partitions is preceded by a
+ backslash as in \textbackslash{}\lstinline+|+, the program will be executed on the
Client's machine instead of on the Director's machine.
Please note that if the filename is given within quotes, you
will need to use two slashes. An example, provided by John Donagher,
that backs up all the local UFS partitions on a remote system is:
\footnotesize
-\begin{verbatim}
+\begin{lstlisting}
FileSet {
Name = "All local partitions"
Include {
File = "\\|bash -c \"df -klF ufs | tail +2 | awk '{print \$6}'\""
}
}
-\end{verbatim}
+\end{lstlisting}
\normalsize
The above requires two backslash characters after the double quote (one
preserves the next one). If you are a Linux user, just change the {\bf ufs}
- to {\bf ext3} (or your preferred filesystem type), and you will be in
- business.
+ to {\bf ext3} (or your preferred filesystem type), and you will be in
+ business.
- If you know what filesystems you have mounted on your system, e.g.
+ If you know what filesystems you have mounted on your system, e.g.
for Red Hat Linux normally only ext2 and ext3, you can backup
all local filesystems using something like:
\footnotesize
-\begin{verbatim}
-
+\begin{lstlisting}
+
Include {
Options { signature = SHA1; onfs=no; fstype=ext2 }
File = /
}
-\end{verbatim}
+\end{lstlisting}
\normalsize
the Job starts, and the data will be assumed to be a list of directories or
files, one per line, to be included. The names should start in column 1 and
should not be quoted even if they contain spaces. This feature allows you to
- modify the external file and change what will be saved without stopping and
+ modify the external file and change what will be saved without stopping and
restarting Bacula as would be necessary if using the @ modifier noted above.
- For example:
+ For example:
\footnotesize
-\begin{verbatim}
+\begin{lstlisting}
Include {
Options { signature = SHA1 }
File = "</home/files/local-filelist"
}
-\end{verbatim}
+\end{lstlisting}
\normalsize
If you precede the less-than sign (\lt{}) with a backslash as in
is given within quotes, you will need to use two slashes.
\footnotesize
-\begin{verbatim}
+\begin{lstlisting}
Include {
Options { signature = SHA1 }
File = "\\</home/xxx/filelist-on-client"
}
-\end{verbatim}
+\end{lstlisting}
\normalsize
\item If you explicitly specify a block device such as {\bf /dev/hda1}, then
Bacula (starting with version 1.28) will assume that this is a raw partition
to be backed up. In this case, you are strongly urged to specify a {\bf
sparse=yes} include option, otherwise, you will save the whole partition
- rather than just the actual data that the partition contains. For example:
+ rather than just the actual data that the partition contains. For example:
\footnotesize
-\begin{verbatim}
+\begin{lstlisting}
Include {
Options { signature=MD5; sparse=yes }
File = /dev/hd6
}
-\end{verbatim}
+\end{lstlisting}
\normalsize
will backup the data in device /dev/hd6. Note, the {bf /dev/hd6} must be
Ludovic Strappazon has pointed out that this feature can be used to backup a
full Microsoft Windows disk. Simply boot into the system using a Linux Rescue
- disk, then load a statically linked Bacula as described in the
+ disk, then load a statically linked Bacula as described in the
\ilink{ Disaster Recovery Using Bacula}{RescueChapter} chapter of
this manual. Then save the whole disk partition. In the case of a disaster,
you can then restore the desired partition by again booting with the rescue
- disk and doing a restore of the partition.
+ disk and doing a restore of the partition.
\item If you explicitly specify a FIFO device name (created with mkfifo), and
you add the option {\bf readfifo=yes} as an option, Bacula will read the FIFO
- and back its data up to the Volume. For example:
+ and back its data up to the Volume. For example:
\footnotesize
-\begin{verbatim}
+\begin{lstlisting}
Include {
Options {
signature=SHA1
}
File = /home/abc/fifo
}
-\end{verbatim}
+\end{lstlisting}
\normalsize
if {\bf /home/abc/fifo} is a fifo device, Bacula will open the fifo,
filename ({\bf filename-string}) is found on the Client in any directory to be
backed up, the whole directory will be ignored (not backed up). For example:
-\begin{verbatim}
+\begin{lstlisting}
# List of files to be backed up
FileSet {
Name = "MyFileSet"
Exclude Dir Containing = .excludeme
}
}
-\end{verbatim}
+\end{lstlisting}
But in /home, there may be hundreds of directories of users and some
people want to indicate that they don't want to have certain
directories backed up. For example, with the above FileSet, if
-the user or sysadmin creates a file named {\bf .excludeme} in
+the user or sysadmin creates a file named {\bf .excludeme} in
specific directories, such as
-\begin{verbatim}
+\begin{lstlisting}
/home/user/www/cache/.excludeme
/home/user/temp/.excludeme
-\end{verbatim}
+\end{lstlisting}
then Bacula will not backup the two directories named:
-\begin{verbatim}
+\begin{lstlisting}
/home/user/www/cache
/home/user/temp
-\end{verbatim}
+\end{lstlisting}
NOTE: subdirectories will not be backed up. That is, the directive
applies to the two directories in question and any children (be they
files, directories, etc).
-\end{itemize}
+\end{bsysitemize}
\section{FileSet Examples}
\index[general]{Examples!FileSet }
to be backed up preceded by a {\bf File =} and on a separate line.
\footnotesize
-\begin{verbatim}
+\begin{lstlisting}
FileSet {
Name = "Full Set"
Include {
File = /usr/lib/another_file
}
}
-\end{verbatim}
+\end{lstlisting}
\normalsize
In the above example, all the files contained in /etc/backup.list will
be compressed with GZIP compression, an SHA1 signature will be computed on the
-file's contents (its data), and sparse file handling will apply.
+file's contents (its data), and sparse file handling will apply.
The two directories /root/myfile and /usr/lib/another\_file will also be saved
without any options, but all files in those directories with the extensions
-{\bf .o} and {\bf .exe} will be excluded.
+{\bf .o} and {\bf .exe} will be excluded.
Let's say that you now want to exclude the directory /tmp. The simplest way
to do so is to add an exclude directive that lists /tmp. The example
above would then become:
-\footnotesize
-\begin{verbatim}
+\footnotesize
+\begin{lstlisting}
FileSet {
Name = "Full Set"
Include {
File = /tmp # don't add trailing /
}
}
-\end{verbatim}
+\end{lstlisting}
\normalsize
it and all files and directories below it will also be excluded.
Now lets take a slight variation on the above and suppose
-you want to save all your whole filesystem except {\bf /tmp}.
+you want to save all your whole filesystem except {\bf /tmp}.
The problem that comes up is that Bacula will not normally
cross from one filesystem to another.
-Doing a {\bf df} command, you get the following output:
+Doing a {\bf df} command, you get the following output:
\footnotesize
-\begin{verbatim}
+\begin{lstlisting}
[kern@rufus k]$ df
Filesystem 1k-blocks Used Available Use% Mounted on
/dev/hda5 5044156 439232 4348692 10% /
deuter:/ 4806936 97684 4465064 3% /mnt/deuter
deuter:/home 4806904 280100 4282620 7% /mnt/deuter/home
deuter:/files 44133352 27652876 14238608 67% /mnt/deuter/files
-\end{verbatim}
+\end{lstlisting}
\normalsize
And we see that there are a number of separate filesystems (/ /boot
Filesystem {\bf /dev/hda5}. To save all filesystems except {\bf /tmp} with
out including any of the Samba or NFS mounted systems, and explicitly
excluding a /tmp, /proc, .journal, and .autofsck, which you will not want to
-be saved and restored, you can use the following:
+be saved and restored, you can use the following:
\footnotesize
-\begin{verbatim}
+\begin{lstlisting}
FileSet {
Name = Include_example
Include {
File = /usr
}
}
-\end{verbatim}
+\end{lstlisting}
\normalsize
Since /tmp is on its own filesystem and it was not explicitly named in the
Include list, it is not really needed in the exclude list. It is better to
list it in the Exclude list for clarity, and in case the disks are changed so
-that it is no longer in its own partition.
+that it is no longer in its own partition.
-Now, lets assume you only want to backup .Z and .gz files and nothing
-else. This is a bit trickier because Bacula by default will select
+Now, lets assume you only want to backup .Z and .gz files and nothing
+else. This is a bit trickier because Bacula by default will select
everything to backup, so we must exclude everything but .Z and .gz files.
If we take the first example above and make the obvious modifications
to it, we might come up with a FileSet that looks like this:
-\footnotesize
-\begin{verbatim}
+\footnotesize
+\begin{lstlisting}
FileSet {
Name = "Full Set"
Include { !!!!!!!!!!!!
File = /myfile
}
}
-\end{verbatim}
+\end{lstlisting}
\normalsize
The *.Z and *.gz files will indeed be backed up, but all other files
We do this with the following:
\footnotesize
-\begin{verbatim}
+\begin{lstlisting}
FileSet {
Name = "Full Set"
Include {
File = /myfile
}
}
-\end{verbatim}
+\end{lstlisting}
\normalsize
The "trick" here was to add a RegexFile expression that matches
Regex code to avoid such system dependencies.
Please be aware that allowing Bacula to traverse or change file systems can be
-{\bf very} dangerous. For example, with the following:
+{\bf very} dangerous. For example, with the following:
\footnotesize
-\begin{verbatim}
+\begin{lstlisting}
FileSet {
Name = "Bad example"
Include {
File = /mnt/matou
}
}
-\end{verbatim}
+\end{lstlisting}
\normalsize
you will be backing up an NFS mounted partition ({\bf /mnt/matou}), and since
{\bf onefs} is set to {\bf no}, Bacula will traverse file systems. Now if {\bf
/mnt/matou} has the current machine's file systems mounted, as is often the
case, you will get yourself into a recursive loop and the backup will never
-end.
+end.
-As a final example, let's say that you have only one or two
+As a final example, let's say that you have only one or two
subdirectories of /home that you want to backup. For example,
you want to backup only subdirectories beginning with the letter
a and the letter b -- i.e. /home/a* and /home/b*. Now, you might first
try:
\footnotesize
-\begin{verbatim}
+\begin{lstlisting}
FileSet {
Name = "Full Set"
Include {
File = /home
}
}
-\end{verbatim}
+\end{lstlisting}
\normalsize
The problem is that the above will include everything in /home. To get
instead of inclusion. So, you could simply exclude all directories
except the two you want to use:
\footnotesize
-\begin{verbatim}
+\begin{lstlisting}
FileSet {
Name = "Full Set"
Include {
File = /home
}
}
-\end{verbatim}
+\end{lstlisting}
\normalsize
And assuming that all subdirectories start with a lowercase letter, this
An alternative would be to include the two subdirectories desired and
exclude everything else:
\footnotesize
-\begin{verbatim}
+\begin{lstlisting}
FileSet {
Name = "Full Set"
Include {
File = /home
}
}
-\end{verbatim}
+\end{lstlisting}
\normalsize
directories and files and excluding everything else.
\footnotesize
-\begin{verbatim}
+\begin{lstlisting}
FileSet {
Name = "AllPictures"
}
}
}
-\end{verbatim}
+\end{lstlisting}
\normalsize
\section{Backing up Raw Partitions}
\index[general]{Backing up!Partitions }
\index[general]{Backing up Raw Partitions }
-The following FileSet definition will backup a raw partition:
+The following FileSet definition will backup a raw partition:
\footnotesize
-\begin{verbatim}
+\begin{lstlisting}
FileSet {
Name = "RawPartition"
Include {
File = /dev/hda2
}
}
-\end{verbatim}
+\end{lstlisting}
\normalsize
While backing up and restoring a raw partition, you should ensure that no
other process including the system is writing to that partition. As a
precaution, you are strongly urged to ensure that the raw partition is not
mounted or is mounted read-only. If necessary, this can be done using the {\bf
-RunBeforeJob} directive.
+RunBeforeJob} directive.
\section{Excluding Files and Directories}
/. For example:
\footnotesize
-\begin{verbatim}
+\begin{lstlisting}
FileSet {
Name = Exclusion_example
Include {
File = .autofsck
}
}
-\end{verbatim}
+\end{lstlisting}
\normalsize
\label{win32}
specified in Unix convention (i.e. forward slash (/)). If you wish to include
a quote in a file name, precede the quote with a backslash
(\textbackslash{}). For example you might use the following
-for a Windows machine to backup the "My Documents" directory:
+for a Windows machine to backup the "My Documents" directory:
\footnotesize
-\begin{verbatim}
+\begin{lstlisting}
FileSet {
Name = "Windows Set"
Include {
File = "c:/My Documents"
}
}
-\end{verbatim}
+\end{lstlisting}
\normalsize
For exclude lists to work correctly on Windows, you must observe the following
-rules:
+rules:
-\begin{itemize}
-\item Filenames are case sensitive, so you must use the correct case.
-\item To exclude a directory, you must not have a trailing slash on the
- directory name.
-\item If you have spaces in your filename, you must enclose the entire name
+\begin{bsysitemize}
+\item Filenames are case sensitive, so you must use the correct case.
+\item To exclude a directory, you must not have a trailing slash on the
+ directory name.
+\item If you have spaces in your filename, you must enclose the entire name
in double-quote characters ("). Trying to use a backslash before the space
- will not work.
+ will not work.
\item If you are using the old Exclude syntax (noted below), you may not
specify a drive letter in the exclude. The new syntax noted above
should work fine including driver letters.
-\end{itemize}
+\end{bsysitemize}
Thanks to Thiago Lima for summarizing the above items for us. If you are
having difficulties getting includes or excludes to work, you might want to
-try using the {\bf estimate job=xxx listing} command documented in the
-\ilink{Console chapter}{estimate} of this manual.
+try using the {\bf estimate job=xxx listing} command documented in the
+\bsysxrlink{estimate}{estimate}{console}{command} of \consoleman{}.
On Win32 systems, if you move a directory or file or rename a file into the
set of files being backed up, and a Full backup has already been made, Bacula
Differential backup (blame Microsoft, not me). To avoid this problem, please
{\bf copy} any new directory or files into the backup area. If you do not have
enough disk to copy the directory or files, move them, but then initiate a
-Full backup.
+Full backup.
\paragraph*{A Windows Example FileSet}
\index[general]{Windows Example FileSet }
The following example was contributed by Russell Howe. Please note that
-for presentation purposes, the lines beginning with Data and Internet
+for presentation purposes, the lines beginning with Data and Internet
have been wrapped and should included on the previous line with one
space.
\footnotesize
-\begin{verbatim}
+\begin{lstlisting}
This is my Windows 2000 fileset:
FileSet {
Name = "Windows 2000"
Exclude = yes
IgnoreCase = yes
# Exclude Mozilla-based programs' file caches
- WildDir = "[A-Z]:/Documents and Settings/*/Application
+ WildDir = "[A-Z]:/Documents and Settings/*/Application
Data/*/Profiles/*/*/Cache"
- WildDir = "[A-Z]:/Documents and Settings/*/Application
+ WildDir = "[A-Z]:/Documents and Settings/*/Application
Data/*/Profiles/*/*/Cache.Trash"
WildDir = "[A-Z]:/Documents and Settings/*/Application
Data/*/Profiles/*/*/ImapMail"
File = "D:/"
}
}
-\end{verbatim}
+\end{lstlisting}
\normalsize
Note, the three line of the above Exclude were split to fit on the document
-page, they should be written on a single line in real use.
+page, they should be written on a single line in real use.
\paragraph*{Windows NTFS Naming Considerations}
\index[general]{Windows NTFS Naming Considerations }
If you wish to get an idea of what your FileSet will really backup or if your
exclusion rules will work correctly, you can test it by using the {\bf
-estimate} command in the Console program. See the
-\ilink{estimate}{estimate} in the Console chapter of this
-manual.
+estimate} command in the Console program. See the
+\bsysxrlink{estimate}{estimate}{console}{command} of \consoleman{}.
As an example, suppose you add the following test FileSet:
\footnotesize
-\begin{verbatim}
+\begin{lstlisting}
FileSet {
Name = Test
Include {
File = /home/xxx/test
Options {
- regex = ".*\.c$"
+ regex = ".*\\.c$"
}
}
}
-\end{verbatim}
+\end{lstlisting}
\normalsize
You could then add some test files to the directory {\bf /home/xxx/test}
and use the following command in the console:
\footnotesize
-\begin{verbatim}
+\begin{lstlisting}
estimate job=<any-job-name> listing client=<desired-client> fileset=Test
-\end{verbatim}
+\end{lstlisting}
\normalsize
-to give you a listing of all files that match.
+to give you a listing of all files that match. In the above
+example, it should be only files with names ending in {\textbf .c}.