Bacula-users

[Bacula-users] RE Job failed, how to recycle only volumes

2013-04-29 12:34:32
Subject: [Bacula-users] RE Job failed, how to recycle only volumes
From: Conrad Lawes <CLawes AT navtech DOT aero>
To: "bacula-users AT lists.sourceforge DOT net" <bacula-users AT lists.sourceforge DOT net>
Date: Mon, 29 Apr 2013 12:14:46 -0400

I wrote a little bash script that demonstrates how to query to bacula tables in postgresql database and purge volumes for a given job.   The same can be accomplished for mysql

In the example below,  I am searching for job ID 8431.

 

 

-----------code-----------------

#!/bin/bash

volumes=`psql -U bacula bacula -c "select distinct  media.volumename from media,jobmedia where jobmedia.mediaid = media.mediaid and jobmedia.jobid=8431 order by media.volumename;" | grep -v volumename  | grep  -v '(' | grep -v '-'`

 

for vol in $volumes

do

echo "Purging  volume $vol"

/usr/sbin/bconsole  << EOF

purge  volume=$vol

EOF

done

 

------------------------------------------------------------------------------
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service 
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_apr
_______________________________________________
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>