[Bacula-users] Getting the currently loaded Volume
2010-12-02 22:44:11
I write the following shell script to find out what Volume is in the
tape drive. It assumes you have an autochanger and are using
mtx-changer. It's just a starting point and I'll incorporate it into
the main RunAfter script later.
-----------------
#!/bin/sh
SLOT=`/usr/local/sbin/mtx-changer /dev/pass10 loaded 0 /dev/sa1 0`
LINE=`/usr/local/sbin/mtx-changer /dev/pass10 list | grep ^${SLOT}`
VOLUME=`echo $LINE | awk 'BEGIN { FS = ":" } ; {print $2}'`
echo $VOLUME
-----------------
Why was this needed?
When you run a CopyJob, the %v volume is the source volume, not the
destination volume. In my case, I am copying to tape and I want to know
the volume I'm writing to so that statistics can be kept.
FYI: I started to write a patch for adding %V to the Run Script
paramters, but I ran into a block.
http://marc.info/?l=bacula-devel&m=129074369216681&w=2
--
Dan Langille - http://langille.org/
------------------------------------------------------------------------------
Increase Visibility of Your 3D Game App & Earn a Chance To Win $500!
Tap into the largest installed PC base & get more eyes on your game by
optimizing for Intel(R) Graphics Technology. Get started today with the
Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
http://p.sf.net/sfu/intelisp-dev2dev
_______________________________________________
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> |
- [Bacula-users] Getting the currently loaded Volume,
Dan Langille <=
|
|
|