Bacula-users

Re: [Bacula-users] script to purge erred volumes

2015-09-04 14:02:58
Subject: Re: [Bacula-users] script to purge erred volumes
From: Ana Emília M. Arruda <emiliaarruda AT gmail DOT com>
To: Raymond <admin AT lctn DOT org>
Date: Fri, 4 Sep 2015 14:57:57 -0300
Hello Raymond,

You can try the script bellow. But if your volume got into Error, I would recommend you to verify the volume before reusing it. This approach can led your backups into the same error if reusing a physically damaged volume.

#!/bin/bash
#

DBHOST=localhost
DATABASE=bacula
USER=bacula
PASSWORD=""

ERROR_VOLS=($(mysql --host=$DBHOST --database=$DATABASE --user=$USER --password=$PASSWORD -N -e "SELECT VolumeName from Media where VolStatus=\"Error\""))

for ((i=0; i<${#ERROR_VOLS[*]}; i++)) do
   echo purge volume=${ERROR_VOLS[i]} | /opt/bacula/bin/bconsole > /dev/null
   if [ $? -eq 0 ]; then
      printf "Volume %s purged\n" ${ERROR_VOLS[i]}
   else
      printf "Volume %s not purged\n" ${ERROR_VOLS[i]}
   fi
done

Best regards,
Ana


On Thu, Sep 3, 2015 at 4:19 PM, Raymond <admin AT lctn DOT org> wrote:
I would like to run a cron job that would use bconsole to purge erred
volumes. Any idea what I could use here:

./bconsole -c ./bconsole.conf <<END_Of_DATA

quit
END_OF_DATA





------------------------------------------------------------------------------
Monitor Your Dynamic Infrastructure at Any Scale With Datadog!
Get real-time metrics from all of your servers, apps and tools
in one place.
SourceForge users - Click here to start your Free Trial of Datadog now!
http://pubads.g.doubleclick.net/gampad/clk?id=241902991&iu=/4140
_______________________________________________
Bacula-users mailing list
Bacula-users AT lists.sourceforge DOT net
https://lists.sourceforge.net/lists/listinfo/bacula-users

------------------------------------------------------------------------------
_______________________________________________
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>