#!/bin/sh # # shell script to update SQLite from version 1.32 to 1.33 # echo " " echo "This script will update a bacula database from version 6 to 7." echo "Depending on the size of your database," echo "this script may take several minutes to run." echo " " # The location of the sqlite program bindir=/usr/lib/sqlite # The location of your bacula working directory cd /var/bacula if [ -s bacula.db ];then DB_VER=`echo "select * from Version;" | $bindir/sqlite bacula.db | tail -n 1 2>/dev/null` if [ -n "$DB_VER" ] && [ "$DB_VER" -ne "6" ]; then echo "Sorry, this script is designed to update a version 6 database" echo "and you have a version $DB_VER database." exit 1 fi else echo "Sorry, I can't seem to locate a bacula database." exit 1 fi $bindir/sqlite $* bacula.db <