Hi List,

I have a situation where I cannot keep all my backup tapes in autochanger.
Instead, that ones that are not going to be used during the week must be
kept in a vault storage. I would like to keep in autochanger only the tapes
that Bacula will try to use the next week and have this information sent to
me by email. How much tapes and pools used can vary. I tried using list
nextvol and various other Bacula´s options, but without success.

So, I tried to create a shell script that could retrieve this information.

Basically, the script do not check the following:

- how many volumes will be used for a backup job;,
- if PurgeOldestVolume or RecycleOldestVolume directives are set;
- if automatic or manual prune or purge are configured or intended to be
used
- if volumes are InChanger or not, just for the case of VolStatus=Append

The script outputs a list of a number of expected volumes to be used from a
Pool that could be used for backup in a specific datetime. For example, to
list all the volumes (you can set a value using --vols) from WeeklyPool
pool to be used at "date +'%F %T":

 /opt/bacula/scripts/list_available_volumes.sh --pool=WeeklyPool
--date="$(date +'%F %T')"
MediaId VolumeName      VolStatus       LastWritten
VolRetention    InChanger
293     000057L5        Append          0000-00-00 00:00:00     3456000
    0
294     000058L5        Append          0000-00-00 00:00:00     3456000
    0
295     000059L5        Append          0000-00-00 00:00:00     3456000
    0
296     000060L5        Append          0000-00-00 00:00:00     3456000
    0
240     000005L5        Purged          2015-01-10 15:09:38     3456000
    0
237     000011L5        Purged          2015-01-31 15:27:16     3456000
    0
241     000009L5        Used            2015-02-21 15:26:55     3456000
    0
233     000010L5        Used            2015-02-28 16:04:23     3456000
    0
275     000044L5        Used            2015-03-14 17:55:21     3456000
    1
292     000056L5        Used            2015-03-21 17:56:32     3456000
    1

The WeeklyPool has a 40 days volume retention time and the volumes
000009L5, 000010L5, 000044L5 and 000056L5 will not be used by Bacula at
 "2015-03-23 15:25:40" (the output for "date +'%F %T") without operator
intervention. But this list permits the operator to be prepared for a
manual prune/purge if it become necessary.

The usage and parameters for the script are documented in the code.

I´m affraid I was not able to find an easy way to have this information
with the actual code/scripts/queries from Bacula. If there is a better
solution for that, please advise me.

The script was tested with a small catalog. So I appreciate your help in
testing this.

Best regards,
Ana

Attachment: list_available_volumes.sh
Description: Bourne shell script

------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Bacula-devel mailing list
Bacula-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-devel

Reply via email to