Bacula-users

Re: [Bacula-users] How can I identifying "slack" in backup volumes?

2009-10-12 22:53:34
Subject: Re: [Bacula-users] How can I identifying "slack" in backup volumes?
From: Cedric Tefft <logicloop AT gmail DOT com>
To: Ben Beuchler <insyte AT gmail DOT com>
Date: Mon, 12 Oct 2009 19:49:51 -0700
Ben Beuchler wrote:
> I'm doing disk-to-disk backups.  Since backup sets fluctuate in size
> quite a bit, it's hard to tell how many volumes may be available to be
> recycled.  This makes it difficult to tell when I need to add
> additional disks.  As it stands, I may have hit a peak in backup size
> several months ago and may now have many volumes that are not
> necessary to meet my retention requirements.
>
>
>   
I'm not positive but I THINK what you're asking for is a way to 
determine which volumes are older than their retention times and are 
therefore eligible for pruning and recycling.  This should just be a 
matter of querying the database.  For instance, this query shows you 
which volumes in the 'Default' pool are old enough to be pruned/recycled:

mysql> select Pool.Name as POOL, Media.VolumeName, Media.VolBytes, 
FROM_UNIXTIME(UNIX_TIMESTAMP(Media.LastWritten)+Media.VolRetention) as 
EXPIRED from Pool LEFT JOIN Media ON Media.PoolId=Pool.PoolId where 
Name='Default' and 
FROM_UNIXTIME(UNIX_TIMESTAMP(Media.LastWritten)+Media.VolRetention) <= 
NOW() order by EXPIRED;
+---------+------------+-------------+---------------------+
| POOL    | VolumeName | VolBytes    | EXPIRED             |
+---------+------------+-------------+---------------------+
| Default | TAPE07     | 20946014208 | 2009-08-28 13:31:04 |
| Default | TAPE14     | 20593843200 | 2009-09-03 10:04:21 |
| Default | TAPE13     | 20034846720 | 2009-09-03 16:18:50 |
| Default | TAPE09     | 17308247040 | 2009-09-03 19:03:16 |
| Default | TAPE02     | 17353792512 | 2009-09-03 21:53:28 |
| Default | TAPE08     | 18065359872 | 2009-09-07 13:02:19 |
| Default | TAPE15     | 27043043328 | 2009-10-01 09:08:56 |
| Default | TAPE11     | 18494300160 | 2009-10-01 13:00:32 |
+---------+------------+-------------+---------------------+
8 rows in set (0.00 sec)

With a little SQL knowledge you should be able to rework this into 
whatever form you need.


- Cedric





------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
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>