4 \chapter{Automatic Volume Recycling}
5 \label{RecyclingChapter}
6 \index[general]{Recycling!Automatic Volume }
7 \index[general]{Automatic Volume Recycling }
9 By default, once Bacula starts writing a Volume, it can append to the
10 volume, but it will not overwrite the existing data thus destroying it.
11 However when Bacula {\bf recycles} a Volume, the Volume becomes available
12 for being reused, and Bacula can at some later time overwrite the previous
13 contents of that Volume. Thus all previous data will be lost. If the
14 Volume is a tape, the tape will be rewritten from the beginning. If the
15 Volume is a disk file, the file will be truncated before being rewritten.
17 You may not want Bacula to automatically recycle (reuse) tapes. This would
18 require a large number of tapes though, and in such a case, it is possible
19 to manually recycle tapes. For more on manual recycling, see the section
20 entitled \ilink{ Manually Recycling Volumes}{manualrecycling} below in this
23 Most people prefer to have a Pool of tapes that are used for daily backups and
24 recycled once a week, another Pool of tapes that are used for Full backups
25 once a week and recycled monthly, and finally a Pool of tapes that are used
26 once a month and recycled after a year or two. With a scheme like this, the
27 number of tapes in your pool or pools remains constant.
29 By properly defining your Volume Pools with appropriate Retention periods,
30 Bacula can manage the recycling (such as defined above) automatically.
32 Automatic recycling of Volumes is controlled by four records in the {\bf
33 Pool} resource definition in the Director's configuration file. These four
38 \item VolumeRetention = \lt{}time\gt{}
40 \item RecyclePool = \lt{}APool\gt{} %(\textit{This require bacula 2.1.4 or greater})
43 The above three directives are all you need assuming that you fill
44 each of your Volumes then wait the Volume Retention period before
45 reusing them. If you want Bacula to stop using a Volume and recycle
46 it before it is full, you will need to use one or more additional
49 \item Use Volume Once = yes
50 \item Volume Use Duration = ttt
51 \item Maximum Volume Jobs = nnn
52 \item Maximum Volume Bytes = mmm
55 the \ilink{Basic Volume Management}{DiskChapter} chapter
56 of this manual for more complete examples.
58 Automatic recycling of Volumes is performed by Bacula only when it wants a
59 new Volume and no appendable Volumes are available in the Pool. It will then
60 search the Pool for any Volumes with the {\bf Recycle} flag set and the
61 Volume Status is {\bf Purged}. At that point, it will choose the oldest
62 purged volume and recycle it.
64 If there are no volumes with Status {\bf Purged}, then
65 the recycling occurs in two steps:
66 The first is that the Catalog for a Volume must be pruned of all Jobs (i.e.
67 Purged). Files contained on that Volume, and the second step is the actual
68 recycling of the Volume. Only Volumes marked {\bf Full} or {\bf Used} will
69 be considerd for pruning. The Volume will be purged if the VolumeRetention
70 period has expired. When a Volume is marked as Purged, it means that no
71 Catalog records reference that Volume, and the Volume can be recycled.
72 Until recycling actually occurs, the Volume data remains intact. If no
73 Volumes can be found for recycling for any of the reasons stated above,
74 Bacula will request operator intervention (i.e. it will ask you to label a
77 A key point mentioned above, that can be a source of frustration, is that Bacula
78 will only recycle purged Volumes if there is no other appendable Volume
79 available, otherwise, it will always write to an appendable Volume before
80 recycling even if there are Volume marked as Purged. This preserves your data
81 as long as possible. So, if you wish to "force" Bacula to use a purged
82 Volume, you must first ensure that no other Volume in the Pool is marked {\bf
83 Append}. If necessary, you can manually set a volume to {\bf Full}. The reason
84 for this is that Bacula wants to preserve the data on your old tapes (even
85 though purged from the catalog) as long as absolutely possible before
86 overwriting it. There are also a number of directives such as
87 {\bf Volume Use Duration} that will automatically mark a volume as {\bf
88 Used} and thus no longer appendable.
91 \section{Automatic Pruning}
92 \index[general]{Automatic Pruning}
93 \index[general]{Pruning!Automatic}
95 As Bacula writes files to tape, it keeps a list of files, jobs, and volumes
96 in a database called the catalog. Among other things, the database helps
97 Bacula to decide which files to back up in an incremental or differential
98 backup, and helps you locate files on past backups when you want to restore
99 something. However, the catalog will grow larger and larger as time goes
100 on, and eventually it can become unacceptably large.
102 Bacula's process for removing entries from the catalog is called Pruning. The
103 default is Automatic Pruning, which means that once an entry reaches a certain
104 age (e.g. 30 days old) it is removed from the catalog. Note that Job records
105 that are required for current restore won't be removed automatically, and File
106 records are needed for VirtualFull and Accurate backups. Once a job has been
107 pruned, you can still restore it from the backup tape, but one additional step
108 is required: scanning the volume with bscan. The alternative to Automatic
109 Pruning is Manual Pruning, in which you explicitly tell Bacula to erase the
110 catalog entries for a volume. You'd usually do this when you want to reuse a
111 Bacula volume, because there's no point in keeping a list of files that USED TO
112 BE on a tape. Or, if the catalog is starting to get too big, you could prune
113 the oldest jobs to save space. Manual pruning is done with the \ilink{ prune
114 command}{ManualPruning} in the console. (thanks to Bryce Denney for the
117 \section{Pruning Directives}
118 \index[general]{Pruning Directives }
119 \index[general]{Directives!Pruning }
121 There are three pruning durations. All apply to catalog database records and
122 not to the actual data in a Volume. The pruning (or retention) durations are
123 for: Volumes (Media records), Jobs (Job records), and Files (File records).
124 The durations inter-depend a bit because if Bacula prunes a Volume, it
125 automatically removes all the Job records, and all the File records. Also when
126 a Job record is pruned, all the File records for that Job are also pruned
127 (deleted) from the catalog.
129 Having the File records in the database means that you can examine all the
130 files backed up for a particular Job. They take the most space in the catalog
131 (probably 90-95\% of the total). When the File records are pruned, the Job
132 records can remain, and you can still examine what Jobs ran, but not the
133 details of the Files backed up. In addition, without the File records, you
134 cannot use the Console restore command to restore the files.
136 When a Job record is pruned, the Volume (Media record) for that Job can still
137 remain in the database, and if you do a "list volumes", you will see the
138 volume information, but the Job records (and its File records) will no longer
141 In each case, pruning removes information about where older files are, but it
142 also prevents the catalog from growing to be too large. You choose the
143 retention periods in function of how many files you are backing up and the
144 time periods you want to keep those records online, and the size of the
145 database. You can always re-insert the records (with 98\% of the original data)
146 by using "bscan" to scan in a whole Volume or any part of the volume that
149 By setting {\bf AutoPrune} to {\bf yes} you will permit {\bf Bacula} to
150 automatically prune all Volumes in the Pool when a Job needs another Volume.
151 Volume pruning means removing records from the catalog. It does not shrink the
152 size of the Volume or affect the Volume data until the Volume gets
153 overwritten. When a Job requests another volume and there are no Volumes with
154 Volume Status {\bf Append} available, Bacula will begin volume pruning. This
155 means that all Jobs that are older than the {\bf VolumeRetention} period will
156 be pruned from every Volume that has Volume Status {\bf Full} or {\bf Used}
157 and has Recycle set to {\bf yes}. Pruning consists of deleting the
158 corresponding Job, File, and JobMedia records from the catalog database. No
159 change to the physical data on the Volume occurs during the pruning process.
160 When all files are pruned from a Volume (i.e. no records in the catalog), the
161 Volume will be marked as {\bf Purged} implying that no Jobs remain on the
162 volume. The Pool records that control the pruning are described below.
166 \item [AutoPrune = \lt{}yes|no\gt{}]
167 \index[console]{AutoPrune }
168 If AutoPrune is set to {\bf yes} (default), Bacula
169 will automatically apply the Volume retention period when running a Job and
170 it needs a new Volume but no appendable volumes are available. At that point,
171 Bacula will prune all Volumes that can be pruned (i.e. AutoPrune set) in an
172 attempt to find a usable volume. If during the autoprune, all files are
173 pruned from the Volume, it will be marked with VolStatus {\bf Purged}. The
174 default is {\bf yes}. Note, that although the File and Job records may be
175 pruned from the catalog, a Volume will be marked Purged (and hence
176 ready for recycling) if the Volume status is Append, Full, Used, or Error.
177 If the Volume has another status, such as Archive, Read-Only, Disabled,
178 Busy, or Cleaning, the Volume status will not be changed to Purged.
180 \item [Volume Retention = \lt{}time-period-specification\gt{}]
181 \index[console]{Volume Retention}
182 The Volume Retention record defines the length of time that Bacula will
183 guarantee that the Volume is not reused counting from the time the last
184 job stored on the Volume terminated. A key point is that this time
185 period is not even considered as long at the Volume remains appendable.
186 The Volume Retention period count down begins only when the Append
187 status has been changed to some othe status (Full, Used, Purged, ...).
189 When this time period expires, and if {\bf AutoPrune} is set to {\bf
190 yes}, and a new Volume is needed, but no appendable Volume is available,
191 Bacula will prune (remove) Job records that are older than the specified
192 Volume Retention period.
194 The Volume Retention period takes precedence over any Job Retention
195 period you have specified in the Client resource. It should also be
196 noted, that the Volume Retention period is obtained by reading the
197 Catalog Database Media record rather than the Pool resource record.
198 This means that if you change the VolumeRetention in the Pool resource
199 record, you must ensure that the corresponding change is made in the
200 catalog by using the {\bf update pool} command. Doing so will insure
201 that any new Volumes will be created with the changed Volume Retention
202 period. Any existing Volumes will have their own copy of the Volume
203 Retention period that can only be changed on a Volume by Volume basis
204 using the {\bf update volume} command.
206 When all file catalog entries are removed from the volume, its VolStatus is
207 set to {\bf Purged}. The files remain physically on the Volume until the
208 volume is overwritten.
210 Retention periods are specified in seconds, minutes, hours, days, weeks,
211 months, quarters, or years on the record. See the
212 \ilink{Configuration chapter}{Time} of this manual for
213 additional details of time specification.
215 The default is 1 year.
216 % TODO: if that is the format, should it be in quotes? decide on a style
218 \item [Recycle = \lt{}yes|no\gt{}]
220 This statement tells Bacula whether or not the particular Volume can be
221 recycled (i.e. rewritten). If Recycle is set to {\bf no} (the
222 default), then even if Bacula prunes all the Jobs on the volume and it
223 is marked {\bf Purged}, it will not consider the tape for recycling. If
224 Recycle is set to {\bf yes} and all Jobs have been pruned, the volume
225 status will be set to {\bf Purged} and the volume may then be reused
226 when another volume is needed. If the volume is reused, it is relabeled
227 with the same Volume Name, however all previous data will be lost.
230 It is also possible to "force" pruning of all Volumes in the Pool
231 associated with a Job by adding {\bf Prune Files = yes} to the Job resource.
234 \label{RecyclingAlgorithm}
235 \section{Recycling Algorithm}
236 \index[general]{Algorithm!Recycling }
237 \index[general]{Recycling Algorithm }
239 After all Volumes of a Pool have been pruned (as mentioned above, this happens
240 when a Job needs a new Volume and no appendable Volumes are available), Bacula
241 will look for the oldest Volume that is Purged (all Jobs and Files expired),
242 and if the {\bf Recycle} flag is on (Recycle=yes) for that Volume, Bacula will
243 relabel it and write new data on it.
245 As mentioned above, there are two key points for getting a Volume
246 to be recycled. First, the Volume must no longer be marked Append (there
247 are a number of directives to automatically make this change), and second
248 since the last write on the Volume, one or more of the Retention periods
249 must have expired so that there are no more catalog backup job records
250 that reference that Volume. Once both those conditions are satisfied,
251 the volume can be marked Purged and hence recycled.
253 The full algorithm that Bacula uses when it needs a new Volume is:
254 \index[general]{New Volume Algorithm}
255 \index[general]{Algorithm!New Volume}
257 The algorithm described below assumes that AutoPrune is enabled,
258 that Recycling is turned on, and that you have defined
259 appropriate Retention periods, or used the defaults for all these
263 \item If the request is for an Autochanger device, look only
264 for Volumes in the Autochanger (i.e. with InChanger set and that have
265 the correct Storage device).
266 \item Search the Pool for a Volume with VolStatus=Append (if there is more
267 than one, the Volume with the oldest date last written is chosen. If
268 two have the same date then the one with the lowest MediaId is chosen).
269 \item Search the Pool for a Volume with VolStatus=Recycle and the InChanger
270 flag is set true (if there is more than one, the Volume with the oldest
271 date last written is chosen. If two have the same date then the one
272 with the lowest MediaId is chosen).
273 \item Try recycling any purged Volumes.
274 \item Prune volumes applying Volume retention period (Volumes with VolStatus
275 Full, Used, or Append are pruned). Note, even if all the File and Job
276 records are pruned from a Volume, the Volume will not be marked Purged
277 until the Volume retention period expires.
278 \item Search the Pool for a Volume with VolStatus=Purged
279 \item If a Pool named "Scratch" exists, search for a Volume and if found
280 move it to the current Pool for the Job and use it. Note, when
281 the Scratch Volume is moved into the current Pool, the basic
282 Pool defaults are applied as if it is a newly labeled Volume
283 (equivalent to an {\bf update volume from pool} command).
284 \item If we were looking for Volumes in the Autochanger, go back to
285 step 2 above, but this time, look for any Volume whether or not
286 it is in the Autochanger.
287 \item Attempt to create a new Volume if automatic labeling enabled
288 If Python is enabled, a Python NewVolume event is generated before
289 the Label Format directve is used. If the maximum number of Volumes
290 specified for the pool is reached, a new Volume will not be created.
291 \item Prune the oldest Volume if RecycleOldestVolume=yes (the Volume with the
292 oldest LastWritten date and VolStatus equal to Full, Recycle, Purged, Used,
293 or Append is chosen). This record ensures that all retention periods are
295 \item Purge the oldest Volume if PurgeOldestVolume=yes (the Volume with the
296 oldest LastWritten date and VolStatus equal to Full, Recycle, Purged, Used,
297 or Append is chosen). We strongly recommend against the use of {\bf
298 PurgeOldestVolume} as it can quite easily lead to loss of current backup
300 \item Give up and ask operator.
303 The above occurs when Bacula has finished writing a Volume or when no Volume
304 is present in the drive.
306 On the other hand, if you have inserted a different Volume after the last job,
307 and Bacula recognizes the Volume as valid, it will request authorization from
308 the Director to use this Volume. In this case, if you have set {\bf Recycle
309 Current Volume = yes} and the Volume is marked as Used or Full, Bacula will
310 prune the volume and if all jobs were removed during the pruning (respecting
311 the retention periods), the Volume will be recycled and used.
313 The recycling algorithm in this case is:
315 \item If the VolStatus is {\bf Append} or {\bf Recycle}
316 is set, the volume will be used.
317 \item If {\bf Recycle Current Volume} is set and the volume is marked {\bf
318 Full} or {\bf Used}, Bacula will prune the volume (applying the retention
319 period). If all Jobs are pruned from the volume, it will be recycled.
322 This permits users to manually change the Volume every day and load tapes in
323 an order different from what is in the catalog, and if the volume does not
324 contain a current copy of your backup data, it will be used.
326 A few points from Alan Brown to keep in mind:
329 \item If a pool doesn't have maximum volumes defined then Bacula will prefer to
330 demand new volumes over forcibly purging older volumes.
332 \item If volumes become free through pruning and the Volume retention period has
333 expired, then they get marked as "purged" and are immediately available for
334 recycling - these will be used in preference to creating new volumes.
336 \item If the Job, File, and Volume retention periods are different, then
337 it's common to see a tape with no files or jobs listed in the database,
338 but which is still not marked as "purged".
342 \section{Recycle Status}
343 \index[general]{Status!Recycle }
344 \index[general]{Recycle Status }
346 Each Volume inherits the Recycle status (yes or no) from the Pool resource
347 record when the Media record is created (normally when the Volume is labeled).
348 This Recycle status is stored in the Media record of the Catalog. Using
349 the Console program, you may subsequently change the Recycle status for each
350 Volume. For example in the following output from {\bf list volumes}:
354 +----------+-------+--------+---------+------------+--------+-----+
355 | VolumeNa | Media | VolSta | VolByte | LastWritte | VolRet | Rec |
356 +----------+-------+--------+---------+------------+--------+-----+
357 | File0001 | File | Full | 4190055 | 2002-05-25 | 14400 | 1 |
358 | File0002 | File | Full | 1896460 | 2002-05-26 | 14400 | 1 |
359 | File0003 | File | Full | 1896460 | 2002-05-26 | 14400 | 1 |
360 | File0004 | File | Full | 1896460 | 2002-05-26 | 14400 | 1 |
361 | File0005 | File | Full | 1896460 | 2002-05-26 | 14400 | 1 |
362 | File0006 | File | Full | 1896460 | 2002-05-26 | 14400 | 1 |
363 | File0007 | File | Purged | 1896466 | 2002-05-26 | 14400 | 1 |
364 +----------+-------+--------+---------+------------+--------+-----+
368 all the volumes are marked as recyclable, and the last Volume, {\bf File0007}
369 has been purged, so it may be immediately recycled. The other volumes are all
370 marked recyclable and when their Volume Retention period (14400 seconds or four
371 hours) expires, they will be eligible for pruning, and possibly recycling.
372 Even though Volume {\bf File0007} has been purged, all the data on the Volume
373 is still recoverable. A purged Volume simply means that there are no entries
374 in the Catalog. Even if the Volume Status is changed to {\bf Recycle}, the
375 data on the Volume will be recoverable. The data is lost only when the Volume
376 is re-labeled and re-written.
378 To modify Volume {\bf File0001} so that it cannot be recycled, you use the
379 {\bf update volume pool=File} command in the console program, or simply {\bf
380 update} and Bacula will prompt you for the information.
384 +----------+------+-------+---------+-------------+-------+-----+
385 | VolumeNa | Media| VolSta| VolByte | LastWritten | VolRet| Rec |
386 +----------+------+-------+---------+-------------+-------+-----+
387 | File0001 | File | Full | 4190055 | 2002-05-25 | 14400 | 0 |
388 | File0002 | File | Full | 1897236 | 2002-05-26 | 14400 | 1 |
389 | File0003 | File | Full | 1896460 | 2002-05-26 | 14400 | 1 |
390 | File0004 | File | Full | 1896460 | 2002-05-26 | 14400 | 1 |
391 | File0005 | File | Full | 1896460 | 2002-05-26 | 14400 | 1 |
392 | File0006 | File | Full | 1896460 | 2002-05-26 | 14400 | 1 |
393 | File0007 | File | Purged| 1896466 | 2002-05-26 | 14400 | 1 |
394 +----------+------+-------+---------+-------------+-------+-----+
398 In this case, {\bf File0001} will never be automatically recycled. The same
399 effect can be achieved by setting the Volume Status to Read-Only.
401 As you have noted, the Volume Status (VolStatus) column in the
402 catalog database contains the current status of the Volume, which
403 is normally maintained automatically by Bacula. To give you an
404 idea of some of the values it can take during the life cycle of
405 a Volume, here is a picture created by Arno Lehmann:
409 A typical volume life cycle is like this:
411 because job count or size limit exceeded
412 Append ----------------------------------------> Used
414 | First Job writes to Retention time passed |
415 | the volume and recycling takes |
418 Recycled <-------------------------------------- Purged
419 Volume is selected for reuse
425 \section{Making Bacula Use a Single Tape}
427 \index[general]{Tape!Making Bacula Use a Single}
428 \index[general]{Making Bacula Use a Single Tape}
430 Most people will want Bacula to fill a tape and when it is full, a new tape
431 will be mounted, and so on. However, as an extreme example, it is possible for
432 Bacula to write on a single tape, and every night to rewrite it. To get this
433 to work, you must do two things: first, set the VolumeRetention to less than
434 your save period (one day), and the second item is to make Bacula mark the
435 tape as full after using it once. This is done using {\bf UseVolumeOnce =
436 yes}. If this latter record is not used and the tape is not full after the
437 first time it is written, Bacula will simply append to the tape and eventually
438 request another volume. Using the tape only once, forces the tape to be marked
439 {\bf Full} after each use, and the next time {\bf Bacula} runs, it will
442 An example Pool resource that does this is:
448 Use Volume Once = yes
451 VolumeRetention = 12h # expire after 12 hours
457 \section{Daily, Weekly, Monthly Tape Usage Example}
459 \index[general]{Daily, Weekly, Monthly Tape Usage Example }
460 \index[general]{Example!Daily Weekly Monthly Tape Usage }
462 This example is meant to show you how one could define a fixed set of volumes
463 that Bacula will rotate through on a regular schedule. There are an infinite
464 number of such schemes, all of which have various advantages and
467 We start with the following assumptions:
470 \item A single tape has more than enough capacity to do a full save.
471 \item There are ten tapes that are used on a daily basis for incremental
472 backups. They are prelabeled Daily1 ... Daily10.
473 \item There are four tapes that are used on a weekly basis for full backups.
474 They are labeled Week1 ... Week4.
475 \item There are 12 tapes that are used on a monthly basis for full backups.
476 They are numbered Month1 ... Month12
477 \item A full backup is done every Saturday evening (tape inserted Friday
478 evening before leaving work).
479 \item No backups are done over the weekend (this is easy to change).
480 \item The first Friday of each month, a Monthly tape is used for the Full
482 \item Incremental backups are done Monday - Friday (actually Tue-Fri
484 % TODO: why this "actually"? does this need to be explained?
487 We start the system by doing a Full save to one of the weekly volumes or one
488 of the monthly volumes. The next morning, we remove the tape and insert a
489 Daily tape. Friday evening, we remove the Daily tape and insert the next tape
490 in the Weekly series. Monday, we remove the Weekly tape and re-insert the
491 Daily tape. On the first Friday of the next month, we insert the next Monthly
492 tape in the series rather than a Weekly tape, then continue. When a Daily tape
493 finally fills up, {\bf Bacula} will request the next one in the series, and
494 the next day when you notice the email message, you will mount it and {\bf
495 Bacula} will finish the unfinished incremental backup.
497 What does this give? Well, at any point, you will have the last complete
498 Full save plus several Incremental saves. For any given file you want to
499 recover (or your whole system), you will have a copy of that file every day
500 for at least the last 14 days. For older versions, you will have at least three
501 and probably four Friday full saves of that file, and going back further, you
502 will have a copy of that file made on the beginning of the month for at least
505 So you have copies of any file (or your whole system) for at least a year, but
506 as you go back in time, the time between copies increases from daily to weekly
509 What would the Bacula configuration look like to implement such a scheme?
515 Run = Level=Full Pool=Monthly 1st sat at 03:05
516 Run = Level=Full Pool=Weekly 2nd-5th sat at 03:05
517 Run = Level=Incremental Pool=Daily tue-fri at 03:05
523 Client = LocalMachine
528 Schedule = "NightlySave"
530 # Definition of file storage device
535 Password = XXXXXXXXXXXXX
542 Options { signature=MD5 }
543 File = fffffffffffffffff
551 VolumeRetention = 10d # recycle in 10 days
557 Use Volume Once = yes
560 VolumeRetention = 30d # recycle in 30 days (default)
565 Use Volume Once = yes
568 VolumeRetention = 365d # recycle in 1 year
574 \section{ Automatic Pruning and Recycling Example}
575 \label{PruningExample}
576 \index[general]{Automatic Pruning and Recycling Example }
577 \index[general]{Example!Automatic Pruning and Recycling }
579 Perhaps the best way to understand the various resource records that come into
580 play during automatic pruning and recycling is to run a Job that goes through
581 the whole cycle. If you add the following resources to your Director's
587 Name = "30 minute cycle"
588 Run = Level=Full Pool=File Messages=Standard Storage=File
590 Run = Level=Full Pool=File Messages=Standard Storage=File
602 Schedule = "30 minute cycle"
604 # Definition of file storage device
607 Address = XXXXXXXXXXX
609 Password = XXXXXXXXXXXXX
616 Options { signature=MD5 }
617 File = fffffffffffffffff
623 Use Volume Once = yes
634 Where you will need to replace the {\bf ffffffffff}'s by the appropriate files
635 to be saved for your configuration. For the FileSet Include, choose a
636 directory that has one or two megabytes maximum since there will probably be
637 approximately eight copies of the directory that {\bf Bacula} will cycle through.
639 In addition, you will need to add the following to your Storage daemon's
647 Archive Device = /tmp
650 AutomaticMount = yes;
657 With the above resources, Bacula will start a Job every half hour that saves a
658 copy of the directory you chose to /tmp/File0001 ... /tmp/File0012. After 4
659 hours, Bacula will start recycling the backup Volumes (/tmp/File0001 ...). You
660 should see this happening in the output produced. Bacula will automatically
661 create the Volumes (Files) the first time it uses them.
663 To turn it off, either delete all the resources you've added, or simply
664 comment out the {\bf Schedule} record in the {\bf Job} resource.
666 \section{Manually Recycling Volumes}
667 \label{manualrecycling}
668 \index[general]{Volumes!Manually Recycling }
669 \index[general]{Manually Recycling Volumes }
671 Although automatic recycling of Volumes is implemented in version 1.20 and
673 \ilink{Automatic Recycling of Volumes}{RecyclingChapter} chapter of
674 this manual), you may want to manually force reuse (recycling) of a Volume.
676 Assuming that you want to keep the Volume name, but you simply want to write
677 new data on the tape, the steps to take are:
680 \item Use the {\bf update volume} command in the Console to ensure that the
681 {\bf Recycle} field is set to {\bf 1}
682 \item Use the {\bf purge jobs volume} command in the Console to mark the
683 Volume as {\bf Purged}. Check by using {\bf list volumes}.
686 Once the Volume is marked Purged, it will be recycled the next time a Volume
689 If you wish to reuse the tape by giving it a new name, follow the following
693 \item Use the {\bf purge jobs volume} command in the Console to mark the
694 Volume as {\bf Purged}. Check by using {\bf list volumes}.
695 \item In Bacula version 1.30 or greater, use the Console {\bf relabel}
696 command to relabel the Volume.
699 Please note that the relabel command applies only to tape Volumes.
701 For Bacula versions prior to 1.30 or to manually relabel the Volume, use the
705 \item Use the {\bf delete volume} command in the Console to delete the Volume
707 \item If a different tape is mounted, use the {\bf unmount} command,
708 remove the tape, and insert the tape to be renamed.
709 \item Write an EOF mark in the tape using the following commands:
713 mt -f /dev/nst0 rewind
718 where you replace {\bf /dev/nst0} with the appropriate device name on your
720 \item Use the {\bf label} command to write a new label to the tape and to
721 enter it in the catalog.
724 Please be aware that the {\bf delete} command can be dangerous. Once it is
725 done, to recover the File records, you must either restore your database as it
726 was before the {\bf delete} command, or use the {\bf bscan} utility program to
727 scan the tape and recreate the database entries.