On Mon, 3 Nov 2008, James Harper wrote: > What I'd really like is some sort of tape validation job. Under Amanda > (sorry :), I ran a script at 10am and 3pm which would email someone if > there was no tape (usb disk actually) present, or if the disk would not > be valid for tonights backup.
I wrote a perl script that queries the tape that is needed for the day. >From my code : query("select p.Name, VolumeName, LastWritten, VolStatus from Media m, Pool p where m.PoolId = p.PoolId and p.Name = \"" . $weekdays[$dow-1] . "Pool-Tape\" order by LastWritten;"); Next, I made a batch script: wanted=`/usr/local/bacula/scripts/wanted.pl -t` slots=`echo -e 'update slots\n3' | /usr/local/bacula/etc/bconsole` echo ${slots} | egrep "$wanted" > /dev/null if [ $? == 1 ] ; then i="I still did not find the volume '$wanted' in the tapedrive. Please load this tape in the tapedrive." echo "$i" | mail -s "Bacula Tape Request" <my-email> so, if i forget to load a tape, I get a mail around 15:00 with the needed tape. K. ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ Bacula-users mailing list Bacula-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bacula-users