Bacula-users

[Bacula-users] Marking all appendable volumes "used", comments on script?

2010-03-15 07:05:20
Subject: [Bacula-users] Marking all appendable volumes "used", comments on script?
From: Administrator <admin AT bbs1emden DOT de>
To: bacula-users AT lists.sourceforge DOT net
Date: Mon, 15 Mar 2010 12:02:21 +0100
Hi
somebody pointed me to shell scripting bacula in order to mark all 
volumes used. Long users of bacula will certainly not find this helpfull 
but well .. hopefully this is not starting a relevance debate ;-)

I backup on two external USB-Disks which i rotate every Week (Monday). I 
need to mark all appendable volumes as used and did not want to use the 
volchanger script. Instead i now query the mysql db for volumes with 
sthe status "append" and tell bconsole to mark these as used:
===================
#!/bin/sh
MYSQL=/usr/bin/mysql
BACULA_DB=bacula5
BACULA_USER=bacula5
BACULA_PASS=not24get
BCONSOLE=/opt/bacula5/etc/bconsole

openVolumes=$(${MYSQL} -u ${BACULA_USER} -p${BACULA_PASS} ${BACULA_DB} 
-sN -e "select VolumeName from Media where VolStatus='Append'")

rm -f updateVolumes.bacula
for volumeName in ${openVolumes}
do
         echo "update volume=${volumeName} volstatus=used" >> 
updateVolumes.bacula
done
${BCONSOLE} < updateVolumes.bacula
======================
I could use bconsole to query for open volumes but that would involve 
some parsing.

Criticism is welcome
M. Müller

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
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>