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 <[email protected]> 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
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/bacula-users
>
------------------------------------------------------------------------------
_______________________________________________
Bacula-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bacula-users