\index[general]{Automatic Volume Recycling }
\addcontentsline{toc}{section}{Automatic Volume Recycling}
-By default, once Bacula starts writing a Volume, it can
-append to the volume, but it will not overwrite the existing
-data thus destroying it.
-However when Bacula {\bf recycles} a Volume, the Volume becomes
-available for being reused, and Bacula can at some later time
-over write the previous contents of that Volume.
-Thus all previous data will be lost. If the Volume is a tape,
-the tape will be rewritten from the beginning. If the Volume is
-a disk file, the file will be truncated before being rewritten.
+By default, once Bacula starts writing a Volume, it can append to the
+volume, but it will not overwrite the existing data thus destroying it.
+However when Bacula {\bf recycles} a Volume, the Volume becomes available
+for being reused, and Bacula can at some later time overwrite the previous
+contents of that Volume. Thus all previous data will be lost. If the
+Volume is a tape, the tape will be rewritten from the beginning. If the
+Volume is a disk file, the file will be truncated before being rewritten.
You may not want Bacula to automatically recycle (reuse) tapes. This would
require a large number of tapes though, and in such a case, it is possible
\item AutoPrune = yes
\item VolumeRetention = \lt{}time\gt{}
\item Recycle = yes
- \end{itemize}
+\end{itemize}
+
+The above three directives are all you need assuming that you fill
+each of your Volumes then wait the Volume Retention period before
+reusing them. If you want Bacula to stop using a Volume and recycle
+it before it is full, you will need to use one or more additional
+directives such as:
+\begin{itemize}
+\item Use Volume Once = yes
+\item Volume Use Duration = ttt
+\item Maximum Volume Jobs = nnn
+\item Maximum Volume Bytes = mmm
+\end{itemize}
+Please see below and
+the \ilink{Basic Volume Management}{_ChapterStart39} chapter
+of this manual for more complete examples.
Automatic recycling of Volumes is performed by Bacula only when it wants a
new Volume and no appendable Volumes are available in the Pool. It will then
Append}. If necessary, you can manually set a volume to {\bf Full}. The reason
for this is that Bacula wants to preserve the data on your old tapes (even
though purged from the catalog) as long as absolutely possible before
-overwriting it.
+overwriting it. There are also a number of directives such as
+{\bf Volume Use Duration} that will automatically mark a volume as {\bf
+Used} and thus no longer appendable.
\label{AutoPruning}
\subsection*{Automatic Pruning}
-\index[general]{Automatic Pruning }
-\index[general]{Pruning!Automatic }
+\index[general]{Automatic Pruning}
+\index[general]{Pruning!Automatic}
\addcontentsline{toc}{subsection}{Automatic Pruning}
-As Bacula writes files to tape, it keeps a list of files, jobs, and volumes in
-a database called the catalog. Among other things, the database helps Bacula
-to decide which files to back up in an incremental or differential backup, and
-helps you locate files on past backups when you want to restore something.
-However, the catalog will grow larger and larger as time goes on, and
-eventually it can become unacceptably large.
-
-Bacula's process for removing entries from the catalog is called Pruning. The
-default is Automatic Pruning, which means that once an entry reaches a certain
-age (e.g. 30 days old) it is removed from the catalog. Once a job has been
-pruned, you can still restore it from the backup tape, but one additional step
-is required: scanning the volume with bscan. The alternative to Automatic
-Pruning is Manual Pruning, in which you explicitly tell Bacula to erase the
-catalog entries for a volume. You'd usually do this when you want to reuse a
-Bacula volume, because there's no point in keeping a list of files that USED
-TO BE on a tape. Or, if the catalog is starting to get too big, you could
-prune the oldest jobs to save space. Manual pruning is done with the
-\ilink{ prune command}{ManualPruning} in the console. (thanks to
-Bryce Denney for the above explanation).
-
-\subsection*{Prunning Directives}
-\index[general]{Prunning Directives }
-\index[general]{Directives!Prunning }
-\addcontentsline{toc}{subsection}{Prunning Directives}
+As Bacula writes files to tape, it keeps a list of files, jobs, and volumes
+in a database called the catalog. Among other things, the database helps
+Bacula to decide which files to back up in an incremental or differential
+backup, and helps you locate files on past backups when you want to restore
+something. However, the catalog will grow larger and larger as time goes
+on, and eventually it can become unacceptably large.
+
+Bacula's process for removing entries from the catalog is called Pruning.
+The default is Automatic Pruning, which means that once an entry reaches a
+certain age (e.g. 30 days old) it is removed from the catalog. Once a job
+has been pruned, you can still restore it from the backup tape, but one
+additional step is required: scanning the volume with bscan. The
+alternative to Automatic Pruning is Manual Pruning, in which you explicitly
+tell Bacula to erase the catalog entries for a volume. You'd usually do
+this when you want to reuse a Bacula volume, because there's no point in
+keeping a list of files that USED TO BE on a tape. Or, if the catalog is
+starting to get too big, you could prune the oldest jobs to save space.
+Manual pruning is done with the \ilink{ prune command}{ManualPruning} in
+the console. (thanks to Bryce Denney for the above explanation).
+
+\subsection*{Pruning Directives}
+\index[general]{Pruning Directives }
+\index[general]{Directives!Pruning }
+\addcontentsline{toc}{subsection}{Pruning Directives}
There are three pruning durations. All apply to catalog database records and
not to the actual data in a Volume. The pruning (or retention) durations are
Busy, or Cleaning, the Volume status will not be changed to Purged.
\item [Volume Retention = \lt{}time-period-specification\gt{}]
- \index[console]{Volume Retention }
- The Volume Retention record defines the length of time that Bacula will
- guarantee that the Volume is not reused counting from the time the last job
- stored on the Volume terminated.
-
- When this time period expires, and if {\bf AutoPrune} is set to {\bf yes},
- and a new Volume is needed, but no appendable Volume is available, Bacula
- will prune (remove) Job records that are older than the specified Volume
- Retention period.
-
- The Volume Retention period takes precedence over any Job Retention period
- you have specified in the Client resource. It should also be noted, that the
- Volume Retention period is obtained by reading the Catalog Database Media
- record rather than the Pool resource record. This means that if you change
- the VolumeRetention in the Pool resource record, you must ensure that the
- corresponding change is made in the catalog by using the {\bf update pool}
- command. Doing so will insure that any new Volumes will be created with the
- changed Volume Retention period. Any existing Volumes will have their own
- copy of the Volume Retention period that can only be changed on a Volume by
- Volume basis using the {\bf update volume} command.
+ \index[console]{Volume Retention}
+ The Volume Retention record defines the length of time that Bacula will
+ guarantee that the Volume is not reused counting from the time the last
+ job stored on the Volume terminated. A key point is that this time
+ period is not even considered as long at the Volume remains appendable.
+ The Volume Retention period count down begins only when the Append
+ status has been changed to some othe status (Full, Used, Purged, ...).
+
+ When this time period expires, and if {\bf AutoPrune} is set to {\bf
+ yes}, and a new Volume is needed, but no appendable Volume is available,
+ Bacula will prune (remove) Job records that are older than the specified
+ Volume Retention period.
+
+ The Volume Retention period takes precedence over any Job Retention
+ period you have specified in the Client resource. It should also be
+ noted, that the Volume Retention period is obtained by reading the
+ Catalog Database Media record rather than the Pool resource record.
+ This means that if you change the VolumeRetention in the Pool resource
+ record, you must ensure that the corresponding change is made in the
+ catalog by using the {\bf update pool} command. Doing so will insure
+ that any new Volumes will be created with the changed Volume Retention
+ period. Any existing Volumes will have their own copy of the Volume
+ Retention period that can only be changed on a Volume by Volume basis
+ using the {\bf update volume} command.
When all file catalog entries are removed from the volume, its VolStatus is
set to {\bf Purged}. The files remain physically on the Volume until the
\item [Recycle = \lt{}yes|no\gt{}]
\index[fd]{Recycle }
- This statement tells Bacula whether or not the particular Volume can be
- recycled (i.e. rewritten). If Recycle is set to {\bf no} (the default), then
- even if Bacula prunes all the Jobs on the volume and it is marked {\bf
- Purged}, it will not consider the tape for recycling. If Recycle is set to
- {\bf yes} and all Jobs have been pruned, the volume status will be set to
- {\bf Purged} and the volume may then be reused when another volume is needed.
- If the volume is reused, it is relabeled with the same Volume Name, however
- all previous data will be lost.
+ This statement tells Bacula whether or not the particular Volume can be
+ recycled (i.e. rewritten). If Recycle is set to {\bf no} (the
+ default), then even if Bacula prunes all the Jobs on the volume and it
+ is marked {\bf Purged}, it will not consider the tape for recycling. If
+ Recycle is set to {\bf yes} and all Jobs have been pruned, the volume
+ status will be set to {\bf Purged} and the volume may then be reused
+ when another volume is needed. If the volume is reused, it is relabeled
+ with the same Volume Name, however all previous data will be lost.
\end{description}
It is also possible to "force" pruning of all Volumes in the Pool
and if the {\bf Recycle} flag is on (Recycle=yes) for that Volume, Bacula will
relabel it and write new data on it.
+As mentioned above, there are two key points for getting a Volume
+to be recycled. First, the Volume must no longer be marked Append (there
+are a number of directives to automatically make this change), and second
+since the last write on the Volume, one or more of the Retention periods
+must have expired so that there are no more catalog backup job records
+that reference that Volume. Once both those conditions are satisfied,
+the volume can be marked Purged and hence recycled.
+
The full algorithm that Bacula uses when it needs a new Volume is:
\begin{itemize}
\subsection*{Making Bacula Use a Single Tape}
\label{singletape}
-\index[general]{Tape!Making Bacula Use a Single }
-\index[general]{Making Bacula Use a Single Tape }
+\index[general]{Tape!Making Bacula Use a Single}
+\index[general]{Making Bacula Use a Single Tape}
\addcontentsline{toc}{subsection}{Making Bacula Use a Single Tape}
Most people will want Bacula to fill a tape and when it is full, a new tape