On Wed, 12 Aug 2015 10:37:13 -0300 (BRT)
Heitor Faria <hei...@bacula.com.br> wrote:

> Hello Andrey: I think it was the developer option not to terminate de
> bls on error if this kind of message / alert happens, after all it's
> not pretty much it's purpose. I think you can change both things with
> a little shell script tricks (if, grep "Block checksum mismach",
> change $?). About redirection:
> http://tldp.org/HOWTO/Bash-Prog-Intro-HOWTO-3.html

Checking output for "Block checksum mismatch" string isn't enough. Error
can be different and due to lack of correct exit code I can't be
confident about volume consistency.

My suggestion based on kiss traditions:

 - 0 exit code if no error or warning
 - all error/warning output to stderr

I this case volume checking is pretty easy:

for i in $(find /bacula/backup/ -type f -mtime +1 -a -mtime -3)
do
  OUTPUT=$(bls -j $i >/dev/null)
  if [ $? != 0 ]; then
    echo "-> Volume $i is damaged"
    echo $OUTPUT
  fi
done

-- 
WBR, Andrey Tataranovich

------------------------------------------------------------------------------
_______________________________________________
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users

Reply via email to