On 2022-02-21 11:46, Chris Wilkinson wrote:
Following a failure of a storage device, I have a number of records
marked as ‘read-only’ in the database.

The backup jobs has been moved to a new storage so these records are
now redundant and I’d like to clean them out.

I looked through bconsole commands but didn’t find a command to do
this except by finding volumes with read only status and deleting them
one by one. Is there a semi-automated way to find and delete read-only
records?


Hi Chris

I think that bconsole delete command would not accept more than
one volume name or volume id.

You could get the list of your read-only volumes from the database
and then use shell one-liner which would send the delete command
through bconsole in a loop.

Instead of retrieving the list of volumes from the database you
could also get them from bconsole + some grepping or awking.

Something like this would give you the list of the names of your
volumes in the Read-Only state from all available pools (you might
want to limit the list to a specific pool using pool=your-pool-name):
echo "list volumes" | bconsole | grep Read-Only | awk '{print $4}'

Then you can take that list of volume names and in a similar manner
call bconsole tool with the delete command in a loop.


Regards!

--
Josip Deanovic


_______________________________________________
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users

Reply via email to