purge jobs with a given fileset

21 views
Skip to first unread message

Phil Doe

unread,
Apr 24, 2024, 5:16:57 AM4/24/24
to bareos...@googlegroups.com
Hi all,

I have a given fileset for some clients and the files related to that
set no longer exist or no longer need to be backupped.
Therefore I want to purge all jobs related to that fileset – even the
past ones, as I have no need of restoring them.

To accomplish this, I wanted to get a list of all jobs related to that
fileset, but bconsole didn't do what I expected it to do. Let's say the
fileset in question is "foo" and its filesetid is 123.

- 'list jobs fileset=foo' returns all jobs.
- 'list jobs filesetid=123' also returns all jobs.
- 'show jobs fileset=foo' returns all jobs plus the 'foo' fileset
- 'list filesets fileset=foo' returns all filesets
- 'list fileset fileset=foo' returns 'jobid not found in db'
- 'list fileset filesetid=123' correctly only returns the 'foo' fileset

Obviously, I did not get the idea of 'list' and 'show'. Instead, I fetch
the jobids from the database:

> select jobid from job where filesetid in (
> select filesetid from fileset where fileset = 'foo'
> ) order by jobid

But how do I feed these jobids to 'purge job'? I'm afraid this command
purges *all* jobs, wipes the database, halts the server and burns down
the data centre.

Or is there another way to get rid of these jobs?

'purge jobs client=...' is not an option as the clients have multiple
jobs assigned.

I will also remove the corresponding job-, fileset- and jobdefs-files
and run bareos-dbcheck.

Thanks & kind regards
Reply all
Reply to author
Forward
0 new messages