]> git.sur5r.net Git - bacula/docs/blobdiff - docs/manual/recycling.tex
Updates
[bacula/docs] / docs / manual / recycling.tex
index eb3fc413925697716895a3dbecb602639e66342c..f52648d1cd9c2dbc540520b4d5c44cb15e5f9b3f 100644 (file)
@@ -144,63 +144,67 @@ volume. The Pool records that control the pruning are described below.
 
 \item [AutoPrune = \lt{}yes|no\gt{}]
    \index[console]{AutoPrune  }
-   If AutoPrune is set to  {\bf yes} (default), Bacula (version 1.20 or greater)
-will  automatically apply the Volume retention period when running a Job  and
-it needs a new Volume but no appendable volumes are available.  At that point,
-Bacula will prune all Volumes that can be pruned  (i.e. AutoPrune set) in an
-attempt to find a usable volume. If  during the autoprune, all files are
-pruned from the Volume, it  will be marked with VolStatus {\bf Purged}.  The
-default is {\bf yes}.  
+   If AutoPrune is set to  {\bf yes} (default), Bacula
+   will  automatically apply the Volume retention period when running a Job  and
+   it needs a new Volume but no appendable volumes are available.  At that point,
+   Bacula will prune all Volumes that can be pruned  (i.e. AutoPrune set) in an
+   attempt to find a usable volume. If  during the autoprune, all files are
+   pruned from the Volume, it  will be marked with VolStatus {\bf Purged}.  The
+   default is {\bf yes}. Note, that although the File and Job records may be 
+   pruned from the catalog, a Volume will be marked Purged (and hence 
+   ready for recycling) if the Volume status is Append, Full, Used, or Error.
+   If the Volume has another status, such as Archive, Read-Only, Disabled,
+   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.  
-
-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
-volume is overwritten.  
-
-Retention periods are specified in seconds,  minutes, hours, days, weeks,
-months,  quarters, or years on the record. See the  
-\ilink{Configuration chapter}{Time} of this  manual for
-additional details of time specification.  
+   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.  
+
+   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
+   volume is overwritten.  
+
+   Retention periods are specified in seconds,  minutes, hours, days, weeks,
+   months,  quarters, or years on the record. See the  
+   \ilink{Configuration chapter}{Time} of this  manual for
+   additional details of time specification.  
 
 The default is 1 year. 
 
 \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. 
-\end{description}
-
-Note, it is also possible to "force" pruning of all Volumes in the Pool
-associated with a Job by adding {\bf Prune Files = yes} to the Job resource. 
-\label{Recycling}
+   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
+   associated with a Job by adding {\bf Prune Files = yes} to the Job resource. 
 
+\label{Recycling}
 \subsection*{Recycling Algorithm}
 \index[general]{Algorithm!Recycling }
 \index[general]{Recycling Algorithm }
@@ -212,20 +216,25 @@ will look for the oldest Volume that is Purged (all Jobs and Files expired),
 and if the {\bf Recycle} flag is on (Recycle=yes) for that Volume, Bacula will
 relabel it and write new data on it. 
 
-The full recycling algorithm that Bacula uses when it needs a new Volume is: 
+The full algorithm that Bacula uses when it needs a new Volume is: 
 
 \begin{itemize}
-\item Search the Pool for a Volume with VolStatus=Append (if there is  more
-   than one, the Volume with the oldest date last written is  chosen. If two have
-   the same date then the one with  the lowest MediaId is chosen). 
-\item Search the Pool for a Volume with VolStatus=Recycle (if there is  more
-   than one, the Volume with the oldest date last written is  chosen. If two have
-   the same date then the one with  the lowest MediaId is chosen). 
+\item Search the Pool for a Volume with VolStatus=Append (if there is more
+   than one, the Volume with the oldest date last written is chosen.  If
+   two have the same date then the one with the lowest MediaId is chosen).
+\item Search the Pool for a Volume with VolStatus=Recycle and the InChanger
+   flag is set true (if there is more than one, the Volume with the oldest
+   date last written is chosen.  If two have the same date then the one
+   with the lowest MediaId is chosen).
 \item Try recycling any purged Volumes.
 \item Prune volumes applying Volume retention period (Volumes with VolStatus 
    Full, Used, or Append are pruned). 
 \item Search the Pool for a Volume with VolStatus=Purged 
+\item If InChanger was set, go back to the first step above, but
+   this second time, ignore the InChanger flag in step 2.
 \item Attempt to create a new Volume if automatic labeling enabled 
+   If Python is enabled, a Python NewVolume even is generated before
+   the Label Format check is used.
 \item If a Pool named "Scratch" exists, search for a Volume and if found
    move it to the current Pool for the Job and use it.
 \item Prune the oldest Volume if RecycleOldestVolume=yes (the Volume  with the
@@ -238,7 +247,7 @@ The full recycling algorithm that Bacula uses when it needs a new Volume is:
    PurgeOldestVolume} as it  can quite easily lead to loss of current backup
    data. 
 \item Give up and ask operator. 
-   \end{itemize}
+\end{itemize}
 
 The above occurs when Bacula has finished writing a Volume or when no Volume
 is present in the drive. 
@@ -248,9 +257,8 @@ and Bacula recognizes the Volume as valid, it will request authorization from
 the Director to use this Volume. In this case, if you have set {\bf Recycle
 Current Volume = yes} and the Volume is marked as Used or Full, Bacula will
 prune the volume and if all jobs were removed during the pruning (respecting
-the retention periods), the Volume will be recycled and used. For this to
-work, you must have {\bf Accept Any Volume = yes} in the Pool. The recycling
-algorithm in this case is: 
+the retention periods), the Volume will be recycled and used. 
+The recycling algorithm in this case is: 
 
 \begin{itemize}
 \item If the VolStatus is {\bf Append} or {\bf Recycle}  and {\bf Accept Any
@@ -584,7 +592,7 @@ new data on the tape, the steps to take are:
    {\bf Recycle} field is set to {\bf 1}  
 \item Use the {\bf purge jobs volume} command in the Console  to mark the
    Volume as {\bf Purged}. Check by using  {\bf list volumes}. 
-   \end{itemize}
+\end{itemize}
 
 Once the Volume is marked Purged, it will be recycled the next time a Volume
 is needed. 
@@ -597,7 +605,7 @@ steps:
    Volume as {\bf Purged}. Check by using  {\bf list volumes}.  
 \item In Bacula version 1.30 or greater, use the Console  {\bf relabel}
    command to relabel the Volume. 
-   \end{itemize}
+\end{itemize}
 
 Please note that the relabel command applies only to tape Volumes. 
 
@@ -611,7 +619,7 @@ instructions below:
    remove the tape, and insert the tape to be  renamed.  
 \item Write an EOF mark in the tape using the following  commands: 
 
-   \footnotesize
+\footnotesize
 \begin{verbatim}
   mt -f /dev/nst0 rewind
   mt -f /dev/nst0 weof
@@ -622,7 +630,7 @@ where you replace {\bf /dev/nst0} with the appropriate  device name on your
 system.  
 \item Use the {\bf label} command to write a new label to  the tape and to
    enter it in the catalog. 
-   \end{itemize}
+\end{itemize}
 
 Please be aware that the {\bf delete} command can be dangerous. Once it is
 done, to recover the File records, you must either restore your database as it