Bacula-users

Re: [Bacula-users] prune/purge/delete not working when using volume id

2009-04-30 13:10:56
Subject: Re: [Bacula-users] prune/purge/delete not working when using volume id
From: John Drescher <drescherjm AT gmail DOT com>
To: Bruno Almeida <bruno.almeida AT net-a-porter DOT com>
Date: Thu, 30 Apr 2009 13:05:11 -0400
On Thu, Apr 30, 2009 at 12:31 PM, Bruno Almeida
<bruno.almeida AT net-a-porter DOT com> wrote:
> Hi All,
>
>
> I upgrade to bacula 3.0.0 and then to 3.0.1 and am having a small
> problem with pruning/purge/delete volume.
>
> It looks like to query sent to mysql is a bit mixed up. It works if I
> use the volume name though.
>
> It's doing a FROM Media WHERE VolumeName='ID' instead WHERE MediaId='ID'
>
> Se the steps done and the query logged on mysql.
>
>
> *prune
> You have the following choices:
>     1: Files
>     2: Jobs
>     3: Volume
>     4: Stats
> Choose item to prune (1-4): 3
> Defined Pools:
>     1: NIX-DME-MONTHLY
>     2: NIX-DME-WKLY-A
>     3: NIX-DME-WKLY-B
>     4: NIX-DME-WKLY-C
>     5: NIX-DME-WKLY-D
>     6: NIX-DME-MONDAY
>     7: NIX-DME-TUESDAY
>     8: NIX-DME-WEDNESDAY
>     9: NIX-DME-THURSDAY
>    10: NIX-DME-DAILY
>    11: NIX-DME-WKLY
> Select the Pool (1-11): 9
> +---------+---------------+-----------+---------+----------------+----------+--------------+---------+------+-----------+-----------+---------------------+
> | MediaId | VolumeName    | VolStatus | Enabled | VolBytes       |
> VolFiles | VolRetention | Recycle | Slot | InChanger | MediaType |
> LastWritten         |
> +---------+---------------+-----------+---------+----------------+----------+--------------+---------+------+-----------+-----------+---------------------+
> |       4 | NIX-DME-THU-A | Used      |       1 | 56,244,916,224 |
>  61 |    1,123,200 |       1 |    0 |         0 | LTO       | 2009-04-24
> 02:40:47 |
> |      12 | NIX-DME-THU-B | Used      |       1 | 46,400,062,464 |
>  52 |    1,123,200 |       1 |    4 |         1 | LTO       | 2009-04-03
> 02:03:18 |
> +---------+---------------+-----------+---------+----------------+----------+--------------+---------+------+-----------+-----------+---------------------+
> Enter *MediaId or Volume name: 12
> sql_get.c:1029 Media record for Volume "12" not found.
>
>

Prefix the mediaid with a * as in

It purges (deletes) all Files from a Job,
JobId, Client or Volume; or it purges (deletes)
all Jobs from a Client or Volume without regard
for retention periods. Normally you should use the
PRUNE command, which respects retention periods.
You have the following choices:
     1: files
     2: jobs
     3: volume
Choose item to purge (1-3): 3
Defined Pools:
     1: Default
     2: Catalogs
     3: Users
     4: Temp
     5: Scratch
Select the Pool (1-5): 1
+---------+---------------+-----------+---------+---------------+----------+--------------+---------+------+-----------+-------------+---------------------+
| mediaid | volumename    | volstatus | enabled | volbytes      |
volfiles | volretention | recycle | slot | inchanger | mediatype   |
lastwritten         |
+---------+---------------+-----------+---------+---------------+----------+--------------+---------+------+-----------+-------------+---------------------+
|       1 | JMD0-Def-0001 | Full      |       1 | 5,368,696,070 |
  1 |    2,592,000 |       1 |    0 |         0 | File        |
2009-04-05 02:10:57 |
|       2 | JMD0-Def-0002 | Full      |       1 | 4,947,230,240 |
  1 |    2,592,000 |       1 |    0 |         0 | File        |
2009-04-05 02:51:27 |
|      12 | JMD0-Def-0012 | Append    |       1 | 1,056,896,794 |
  0 |    2,592,000 |       1 |    0 |         0 | File        |
2009-04-30 02:11:19 |
|      14 | JMD0-Def-0014 | Full      |       1 | 5,368,696,890 |
  1 |    2,592,000 |       1 |    0 |         0 | File        |
2009-03-28 02:09:00 |
|      27 | JMD0-Def-0027 | Full      |       1 | 5,368,703,580 |
  1 |    2,592,000 |       1 |    0 |         0 | File        |
2009-04-13 02:06:29 |
|      31 | JMD0-Def-0031 | Full      |       1 | 5,368,673,136 |
  1 |    2,592,000 |       1 |    0 |         0 | File        |
2009-04-21 02:09:44 |
|      36 | JMD0-Def-0036 | Full      |       1 | 5,368,654,783 |
  1 |    2,592,000 |       1 |    0 |         0 | File        |
2009-04-22 02:28:05 |
|      44 | JMD0-Def-0044 | Full      |       1 | 5,368,687,123 |
  1 |    2,592,000 |       1 |    0 |         0 | File        |
2009-04-28 02:06:10 |
|      49 | JMD0-Def-0049 | Full      |       1 | 5,368,699,865 |
  1 |    2,592,000 |       1 |    0 |         0 | File        |
2009-04-19 02:14:20 |
|      50 | JMD0-Def-0050 | Error     |       1 |             0 |
  0 |    2,592,000 |       1 |    0 |         0 | File        |
             |
|      51 | JMD0-Def-0051 | Append    |       1 |             0 |
  0 |    2,592,000 |       1 |    0 |         0 | DVD         |
             |
|      52 | JMD0-Def-0052 | Append    |       1 |   597,771,314 |
  0 |    2,592,000 |       1 |    0 |         0 | OfflineFile |
2009-03-25 12:32:24 |
|      53 | JMD0-Def-0053 | Error     |       1 |             0 |
  0 |    2,592,000 |       1 |    0 |         0 | File        |
             |
+---------+---------------+-----------+---------+---------------+----------+--------------+---------+------+-----------+-------------+---------------------+
Enter *MediaId or Volume name: *50
0 Files on Volume "JMD0-Def-0050" purged from catalog.
There are no more Jobs associated with Volume "JMD0-Def-0050". Marking
it purged.
*


John

------------------------------------------------------------------------------
Register Now & Save for Velocity, the Web Performance & Operations 
Conference from O'Reilly Media. Velocity features a full day of 
expert-led, hands-on workshops and two days of sessions from industry 
leaders in dedicated Performance & Operations tracks. Use code vel09scf 
and Save an extra 15% before 5/3. http://p.sf.net/sfu/velocityconf
_______________________________________________
Bacula-users mailing list
Bacula-users AT lists.sourceforge DOT net
https://lists.sourceforge.net/lists/listinfo/bacula-users