Discussion:
[Bacula-users] How to clear the data
Quanzhong Zhang
2008-11-03 03:43:57 UTC
Permalink
Hello,

I am using bacula to backup my data. I found there many invalid data in
the bacula database now. I want to erase all this related data, e.g.
1. Erase all the related data for a special client.
2. Erase all the related data for a special client before a specified
time.
Could you give any idea?

Thanks and Best Regards,
Zhang QZ
John Drescher
2008-11-03 04:17:38 UTC
Permalink
On Sun, Nov 2, 2008 at 10:43 PM, Quanzhong Zhang
Post by Quanzhong Zhang
Hello,
I am using bacula to backup my data. I found there many invalid data in
the bacula database now. I want to erase all this related data, e.g.
1. Erase all the related data for a special client.
2. Erase all the related data for a special client before a specified
time.
Could you give any idea?
purge jobs

from bconsole and follow the prompts

John
Quanzhong Zhang
2008-11-11 01:28:28 UTC
Permalink
Hello,

I found there are many restore job history in the table "Job", and can
not find out the way for clear it.
Could you kindly give me help?

Thanks and Best Regards,
Zhang QZ
Dan Langille
2008-11-11 01:39:36 UTC
Permalink
Post by Quanzhong Zhang
Hello,
I found there are many restore job history in the table "Job", and can
not find out the way for clear it.
Could you kindly give me help?
Why do you want to clear it?
Martin Simmons
2008-11-11 10:57:20 UTC
Permalink
Post by Quanzhong Zhang
Hello,
I found there are many restore job history in the table "Job", and can
not find out the way for clear it.
Could you kindly give me help?
Bacula never deletes them.

I run the following SQL once a week (on PostgreSQL) to delete those older than
2 months:

delete from job where type in ('V', 'D') and starttime < now()-interval '2 months';

__Martin
Quanzhong Zhang
2008-11-12 02:47:11 UTC
Permalink
Hello Martin,

Thank you very much for your replay!
But are you sure there are no related data in other table for this data?

Best Regards,
Zhang QZ


-----Original Message-----
From: Martin Simmons [mailto:***@lispworks.com]
Sent: Tuesday, November 11, 2008 6:57 PM
To: Quanzhong Zhang
Cc: bacula-***@lists.sourceforge.net
Subject: Re: [Bacula-users] How to clear the restore job history
Post by Quanzhong Zhang
Hello,
I found there are many restore job history in the table "Job", and can
not find out the way for clear it.
Could you kindly give me help?
Bacula never deletes them.

I run the following SQL once a week (on PostgreSQL) to delete those
older than
2 months:

delete from job where type in ('V', 'D') and starttime < now()-interval
'2 months';

__Martin
Martin Simmons
2008-11-12 17:13:12 UTC
Permalink
There is no other related data for these jobs.

I made a mistake though: you need

delete from job where type in ('R') ...

to delete restore jobs. Type 'V' is verify and type 'D' is admin.

__Martin
Post by Quanzhong Zhang
Hello Martin,
Thank you very much for your replay!
But are you sure there are no related data in other table for this data?
Best Regards,
Zhang QZ
-----Original Message-----
Sent: Tuesday, November 11, 2008 6:57 PM
To: Quanzhong Zhang
Subject: Re: [Bacula-users] How to clear the restore job history
Post by Quanzhong Zhang
Hello,
I found there are many restore job history in the table "Job", and can
not find out the way for clear it.
Could you kindly give me help?
Bacula never deletes them.
I run the following SQL once a week (on PostgreSQL) to delete those older than
delete from job where type in ('V', 'D') and starttime < now()-interval '2 months';
__Martin
Loading...