Bacula-users

Re: [Bacula-users] Speeding up pruning

2011-04-05 21:33:32
Subject: Re: [Bacula-users] Speeding up pruning
From: Dan Langille <dan AT langille DOT org>
To: Martin Simmons <martin AT lispworks DOT com>
Date: Tue, 5 Apr 2011 21:31:51 -0400
On Apr 5, 2011, at 1:34 PM, Martin Simmons wrote:

>>>>>> On Tue, 5 Apr 2011 14:35:07 +0100, Dermot Beirne said:
>> 
>>>>>>>> On Tue, 5 Apr 2011 07:40:44 +0100, Dermot Beirne said:
>>>> 
>>>> I'm sure that would be fine, but I'm having difficulty automatically
>>>> determining which volumes are ok to prune. I need to compare the last
>>>> written time to the current time and the volumes retention, and check the
>>>> job type and status too to narrow the selection.
>> 
>>> Why do you need to do that?  The prune jobs command does most of what you
>>> want, using the configured retention times etc.
>>> 
>>> __Martin
>> 
>> I am trying to prune Volumes, not jobs.
>> 
>> If I use the prune command manually, I have to know what volume I want
>> it to prune, and which pool it's in.
>> 
>> To identify the volume, I need to check that it's past it retention
>> time before I prune it.
>> 
>> I currently have a volume in a pool which is several weeks past it's
>> retention time.
>> The mediaid is 986.
>> 
>> After running prune, choosing Volume, and then the pool, I am
>> presented with a list of volumes in that pool.
>> 
>> When I enter the ID, it tells me the current retention time is 2 days,
>> even though it was last written to back in January:
>> 
>> Enter *MediaId or Volume name: *986
>> The current Volume retention period is: 2 days
>> Continue? (yes/mod/no):
>> 
>> I have to choose Yes to get it to prune it.
>> 
>> Is the above normal, and is there some way, given a pool, it will just
>> prune any volume in that pool past the retention.
> 
> Yes, the above is normal for the prune volumes command.  To remove the
> prompts, try
> 
> prune volume=blahblah yes
> 
> It only works with a volume name, not an id.
> 
> Bacula's automatic recycling only kicks in when it runs out of appendable
> volumes, so a volume could easily remain in the Used state for a long time
> past its retention period.
> 
> You could also try
> 
> prune jobs client=...
> 
> to prune all jobs for a client based on the Job Retention period and then use
> SQL to find the volumes that have no remaining jobs.
> 
> 
>> I want that to happen on a schedule, to both clear old disk volumes
>> and free space (using truncate), and also for my Tape volumes, to put
>> them back in the scratch pool automatically once expired.
>> Currently, when scratch tapes run low, I have to go through my Tape
>> volumes, and purge the oldest manually.  Even then, they only
>> sometimes go to the scratch pool, other times I have to manually
>> change the pool to the Scratch pool after purging.
> 
> Sorry, I don't use the Scratch pool so I don't know if/how that is supposed to
> work.
> 
> 
>> The Next Pool directive is set to Scratch in the Pool configuration
>> for all my Tape pools.
> 
> Should that be the Scratch Pool directive, not Next Pool?

I think you are correct.  Next Pool is for Migration/Copy, not for Scratch.

I think the OP wants: RecyclePool

http://bacula.org/5.0.x-manuals/en/main/main/Configuring_Director.html#SECTION0018150000000000000000

RecyclePool = pool-resource-name
This directive defines to which pool the Volume will be placed (moved) when it 
is recycled. Without this directive, a Volume will remain in the same pool when 
it is recycled. With this directive, it can be moved automatically to any 
existing pool during a recycle. This directive is probably most useful when 
defined in the Scratch pool, so that volumes will be recycled back into the 
Scratch pool. For more on the see the Scratch PoolTheScratchPool section of 
this manual.
Although this directive is called RecyclePool, the Volume in question is 
actually moved from its current pool to the one you specify on this directive 
when Bacula prunes the Volume and discovers that there are no records left in 
the catalog and hence marks it as Purged.
------------------------------------------------------------------------------
Xperia(TM) PLAY
It's a major breakthrough. An authentic gaming
smartphone on the nation's most reliable network.
And it wants your games.
http://p.sf.net/sfu/verizon-sfdev
_______________________________________________
Bacula-users mailing list
Bacula-users AT lists.sourceforge DOT net
https://lists.sourceforge.net/lists/listinfo/bacula-users

<Prev in Thread] Current Thread [Next in Thread>