From b8b2ed2a6db4fb8436647d438185a364951375fc Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Wed, 17 Mar 2004 22:15:48 +0000 Subject: [PATCH] First cut restore GUI git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@1137 91ce42f0-d328-0410-95d8-f526ca767f89 --- .../Sun-desktop-20Gb-4mm-autoloader | 43 + .../examples/autochangers/ak-mtx-changer.txt | 218 +++ bacula/examples/autochangers/bacula-barcodes | 53 + bacula/examples/autochangers/chio-bacula | 138 ++ bacula/examples/autochangers/chio-changer | 125 ++ .../autochangers/mtx-changer.Adic-Scalar-100 | 1180 ++++++++++++ .../autochangers/mtx-changer.Adic-Scalar-24 | 40 + .../mtx-changer.StorageTek-HPA4853 | 137 ++ bacula/examples/backup-acls.txt | 22 + bacula/examples/conf/bacula-dir.conf | 449 +++++ bacula/examples/conf/bacula-fd.conf | 31 + bacula/examples/conf/bacula-sd.conf | 53 + bacula/examples/conf/console.conf | 10 + bacula/examples/conf/defaultconfig | 24 + bacula/examples/conf/gnome-console.conf | 10 + bacula/examples/conf/kernsconfig | 17 + bacula/examples/conf/many-clients.txt | 106 ++ bacula/examples/dbdump/postgresql-dump.txt | 42 + .../examples/dbdump/postgresql-mysql-dump.txt | 99 + bacula/examples/nagios.txt | 116 +- bacula/kernstodo | 25 +- bacula/src/cats/sql.c | 43 +- bacula/src/cats/sql_create.c | 4 +- bacula/src/cats/sql_get.c | 4 +- bacula/src/console2.glade | 1605 +++++++++++++---- bacula/src/dird/ua_restore.c | 7 +- bacula/src/lib/protos.h | 4 +- bacula/src/lib/scan.c | 151 +- bacula/src/tools/bsmtp.c | 2 +- bacula/src/version.h | 4 +- 30 files changed, 4223 insertions(+), 539 deletions(-) create mode 100644 bacula/examples/autochangers/Sun-desktop-20Gb-4mm-autoloader create mode 100644 bacula/examples/autochangers/ak-mtx-changer.txt create mode 100644 bacula/examples/autochangers/bacula-barcodes create mode 100644 bacula/examples/autochangers/chio-bacula create mode 100644 bacula/examples/autochangers/chio-changer create mode 100755 bacula/examples/autochangers/mtx-changer.Adic-Scalar-100 create mode 100755 bacula/examples/autochangers/mtx-changer.Adic-Scalar-24 create mode 100755 bacula/examples/autochangers/mtx-changer.StorageTek-HPA4853 create mode 100644 bacula/examples/backup-acls.txt create mode 100644 bacula/examples/conf/bacula-dir.conf create mode 100644 bacula/examples/conf/bacula-fd.conf create mode 100644 bacula/examples/conf/bacula-sd.conf create mode 100644 bacula/examples/conf/console.conf create mode 100755 bacula/examples/conf/defaultconfig create mode 100644 bacula/examples/conf/gnome-console.conf create mode 100755 bacula/examples/conf/kernsconfig create mode 100644 bacula/examples/conf/many-clients.txt create mode 100644 bacula/examples/dbdump/postgresql-dump.txt create mode 100644 bacula/examples/dbdump/postgresql-mysql-dump.txt diff --git a/bacula/examples/autochangers/Sun-desktop-20Gb-4mm-autoloader b/bacula/examples/autochangers/Sun-desktop-20Gb-4mm-autoloader new file mode 100644 index 0000000000..4ffbda58c8 --- /dev/null +++ b/bacula/examples/autochangers/Sun-desktop-20Gb-4mm-autoloader @@ -0,0 +1,43 @@ +From: Lucas Mingarro +To: +Subject: [Bacula-users] Sun Desktop 20Gb 4mm autoloader +Date: Mon, 2 Dec 2002 15:42:43 -0300 (ART) + +Hi, + If you have an old Sun Desktop 20Gb 4mm autoloader (Archive Python +29279) and you want to make it work on Linux with Bacula here are my conf +files. + +I'm using Redhat Linux 7.1 with Bacula 1.26a. + +First add these lines to your stini.def + +manufacturer=ARCHIVE modepl = "Python 29279" { +scsi2logical=0 can-bsr can-partitions auto-lock +mode1 blocksize=0 compression=0 density=0x13 # /dev/nst0 DDS (61000 bpi) +mode2 blocksize=1024 compression=0 density=0x13 # /dev/nst0l DDS (61000 bpi) +mode3 blocksize=0 compression=1 density=0x24 # /dev/nst0m DDS-2 +mode4 blocksize=1024 compression=1 density=0x24 # /dev/nst0a DDS-2 +} + +and Python29279-autoloader.conf + +# +# This is the definition Lucas uses for a +# Sun Desktop 20Gb 4mm autoloader (Archive Python 29279) +# +Device { + Name = "Python 29279" + Media Type = "4mm" + Archive Device = /dev/nst0a + Auto Changer = Yes + Changer Device = /dev/sg0 + Changer Command = "/usr/local/etc/mtx-changer %c %o %S %a" + AutomaticMount = yes; # when device opened, read it + AlwaysOpen = no; +} + +Thats all +Good Luck + +Lucas Mingarro diff --git a/bacula/examples/autochangers/ak-mtx-changer.txt b/bacula/examples/autochangers/ak-mtx-changer.txt new file mode 100644 index 0000000000..671d2335ca --- /dev/null +++ b/bacula/examples/autochangers/ak-mtx-changer.txt @@ -0,0 +1,218 @@ +#!/bin/sh +# +# The use of this script for Totally Automating Tape usage is +# described in the Tips chapter of the manual. +# +# Bacula interface to mtx autoloader +# +# Created OCT/31/03 by Alexander Kuehn, derived from Ludwig Jaffe's script +# +# Works with the HP C1537A L708 DDS3 +# +#set -x +# these are the labels of the tapes in each virtual slot, not the slots! +labels="PSE-0001 PSE-0002 PSE-0003 PSE-0004 PSE-0005 PSE-0006 PSE-0007 PSE-0008 PSE-0009 PSE-0010 PSE-0011 PSE-0012" + +# who to send a mail to? +recipient=root@localhost +logfile=/var/log/mtx.log + +# Delay in seconds how often to check whether a new tape has been inserted +TAPEDELAY=10 # the default is every 10 seconds +echo `date` ":" $@ >>$logfile + +# change this if mt is not in the path (use different quotes!) +mt=`which mt` +grep=`which grep` +# +# how to run the console application? +console="/usr/local/sbin/console -c /usr/local/etc/console.conf" + +command="$1" + +#TAPEDRIVE0 holds the device/name of your 1st and only drive (Bacula supports only 1 drive currently) +#Read TAPEDRIVE from command line parameters +if [ -z "$2" ] ; then + TAPEDRIVE0=/dev/nsa0 +else + TAPEDRIVE0=$2 +fi + +#Read slot from command line parameters +if [ -z "$3" ] ; then + slot=`expr 1` +else + slot=`expr $3` +fi + +if [ -z "$command" ] ; then + echo "" + echo "The mtx-changer script for Bacula" + echo "---------------------------------" + echo "" + echo "usage: mtx-changer [slot]" + echo " mtx-changer" + echo "" + echo "Valid commands:" + echo "" + echo "unload Unloads a tape into the slot" + echo " from where it was loaded." + echo "load Loads a tape from the slot " + echo "list Lists full storage slots" + echo "loaded Gives slot from where the tape was loaded." + echo " 0 means the tape drive is empty." + echo "slots Gives Number of avialable slots." + echo "volumes List avialable slots and the label of the." + echo " tape in it (slot:volume)" + echo "Example:" + echo " mtx-changer load /dev/nst0 1 loads a tape from slot1" + echo " mtx-changer %a %o %S " + echo "" + exit 0 +fi + + +case "$command" in + unload) + # At first do mt -f /dev/st0 offline to unload the tape + # + # Check if you want to fool me + echo "unmount"|$console >/dev/null 2>/dev/null + echo "mtx-changer: Checking if drive is loaded before we unload. Request unload" >>$logfile + if $mt -f $TAPEDRIVE0 status >/dev/null 2>/dev/null ; then # mt says status ok + echo "mtx-changer: Doing mt -f $TAPEDRIVE0 rewoffl to rewind and unload the tape!" >>$logfile + $mt -f $TAPEDRIVE0 rewoffl + else + echo "mtx-changer: *** Don't fool me! *** The Drive $TAPEDRIVE0 is empty." >>$logfile + fi + exit 0 + ;; + + load) + #Let's check if drive is loaded before we load it + echo "mtx-changer: Checking if drive is loaded before we load. I Request loaded" >>$logfile + LOADEDVOL=`echo "status Storage"|$console|$grep $TAPEDRIVE0|grep ^Device|grep -v "not open."|grep -v "ERR="|grep -v "no Bacula volume is mounted"|sed -e s/^.*Volume\ //|cut -d\" -f2` +# if [ -z "$LOADEDVOL" ] ; then # this is wrong, becaus Bacula would try to use the tape if we mount it! +# LOADEDVOL=`echo "mount"|$console|$grep $TAPEDRIVE0|grep Device|grep -v "not open."|grep -v "ERR="|sed -e s/^.*Volume\ //|cut -d\" -f2` +# if [ -z "$LOADEDVOL" ] ; then +# echo "mtx-changer: The Drive $TAPEDRIVE0 is empty." >>$logfile +# else # restore state? +# if [ $LOADEDVOL = $3 ] ; then # requested Volume mounted -> exit +# echo "mtx-changer: *** Don't fool me! *** Tape $LOADEDVOL is already in drive $TAPEDRIVE0!" >>$logfile +# exit +# else # oops, wrong volume +# echo "unmount"|$console >/dev/null 2>/dev/null +# fi +# fi +# fi + if [ -z "$LOADEDVOL" ] ; then + echo "unmount"|$console >/dev/null 2>/dev/null + LOADEDVOL=0 + else + #Check if you want to fool me + if [ $LOADEDVOL = $3 ] ; then + echo "mtx-changer: *** Don't fool me! *** Tape $LOADEDVOL is already in drive $TAPEDRIVE0!" >>$logfile + exit + fi + echo "mtx-changer: The Drive $TAPEDRIVE0 is loaded with the tape $LOADEDVOL" >>$logfile + echo "mtx-changer: Unmounting..." >>$logfile + echo "unmount"|$console >/dev/null 2>/dev/null + fi + echo "mtx-changer: Unloading..." >>$logfile + echo "mtx-changer: Doing mt -f $TAPEDRIVE0 rewoffl to rewind and unload the tape!" >>$logfile + mt -f $TAPEDRIVE0 rewoffl 2>/dev/null + #Now we can load the drive as desired + echo "mtx-changer: Doing mtx -f $1 $2 $3" >>$logfile + # extract label for the mail + count=`expr 1` + for label in $labels ; do + if [ $slot -eq $count ] ; then volume=$label ; fi + count=`expr $count + 1` + done + + mail -s "Bacula needs volume $volume." $recipient </dev/null 2>/dev/null + while [ $? -ne 0 ] ; do + sleep $TAPEDELAY + $mt status >/dev/null 2>/dev/null + done + mail -s "Bacula says thank you." $recipient <>$logfile + echo "Loading finished." ; >>$logfile + echo "$slot" + exit 0 + ;; + + list) + echo "mtx-changer: Requested list" >>$logfile + LOADEDVOL=`echo "status Storage"|$console|$grep $TAPEDRIVE0|grep ^Device|grep -v "not open."|grep -v "ERR="|grep -v "no Bacula volume is mounted"|sed -e s/^.*Volume\ //|cut -d\" -f2` + if [ -z $LOADEDVOL ] ; then # try mounting + LOADEDVOL=`echo "mount"|$console|$grep $TAPEDRIVE0|grep Device|grep -v "not open."|grep -v "ERR="|sed -e s/^.*Volume\ //|cut -d\" -f2` + if [ -z $LOADEDVOL ] ; then # no luck + LOADEDVOL="_no_tape" + else # restore state + echo "unmount"|$console >/dev/null 2>/dev/null + fi + fi + count=`expr 1` + for label in $labels ; do + if [ "$label" != "$LOADEDVOL" ] ; then + printf "$count " + fi + count=`expr $count + 1` + done + printf "\n" + ;; + + loaded) + echo "mtx-changer: Request loaded, dev $TAPEDRIVE0" >>$logfile + LOADEDVOL=`echo "status Storage"|$console|$grep $TAPEDRIVE0|grep ^Device|grep -v "not open."|grep -v "ERR="|grep -v "no Bacula volume is mounted"|sed -e s/^.*Volume\ //|cut -d\" -f2` + if [ -z $LOADEDVOL ] ; then + LOADEDVOL=`echo "mount"|$console|$grep $TAPEDRIVE0|grep Device|grep -v "not open."|grep -v "ERR="|grep -v "no Bacula volume is mounted"|sed -e s/^.*Volume\ //|cut -d\" -f2` + if [ -z "$LOADEDVOL" ] ; then # no luck + echo "$TAPEDRIVE0 not mounted!" >>$logfile + else # restore state + echo "unmount"|$console >/dev/null 2>/dev/null + fi + fi + if [ -z "$LOADEDVOL" ] ; then + LOADEDVOL="_no_tape" >>$logfile + echo "0" + else + count=`expr 1` + for label in $labels ; do + if [ $LOADEDVOL = $label ] ; then echo $count ; fi + count=`expr $count + 1` + done + fi + exit 0 + ;; + + slots) + echo "mtx-changer: Request slots" >>$logfile + count=`expr 0` + for label in $labels ; do + count=`expr $count + 1` + done + echo $count + ;; + + volumes) + echo "mtx-changer: Request volumes" >>$logfile + count=`expr 1` + for label in $labels ; do + printf "$count:$label " + count=`expr $count + 1` + done + printf "\n" + ;; +esac diff --git a/bacula/examples/autochangers/bacula-barcodes b/bacula/examples/autochangers/bacula-barcodes new file mode 100644 index 0000000000..534101010a --- /dev/null +++ b/bacula/examples/autochangers/bacula-barcodes @@ -0,0 +1,53 @@ +# +# Bacula barcode simulation file +# used by ${PREFIX}/sbin/chio-bacula (FreeBSD) +# +# Contributed by Lars Koeller +# +# The volumenames are returned by the "changer list" command +# labeling in the console is done by "label barcodes" +# (then all volumes belog to the default pool). +# All Lines with an "#" at the bedinning are ignored +# +# !!!! If you export an tape and reinsert another one, +# !!!! don't forget to change the volume name in this file! +# +1:Volume1-100 +2:Volume1-101 +3:Volume1-102 +4:Volume1-103 +5:Volume1-104 +6:Volume1-105 +7:Volume1-106 +8:Volume1-107 +9:Volume1-108 +10:Volume1-109 +11:Volume1-110 +12:Volume1-111 +# +# Further volumes exported from the changer +# +# 36GB AIT2 tapes +#Volume1-100 +#Volume1-101 +#Volume1-102 +#Volume1-103 +#Volume1-104 +#Volume1-105 +#Volume1-106 +#Volume1-107 +#Volume1-108 +#Volume1-109 +#Volume1-110 +#Volume1-111 +#Volume1-112 +#Volume1-113 +#Volume1-114 +#Volume1-115 +# +# 50GB AIT2 tapes +#Volume2-200 +#Volume2-201 +#Volume2-202 +#Volume2-203 +#Volume2-204 diff --git a/bacula/examples/autochangers/chio-bacula b/bacula/examples/autochangers/chio-bacula new file mode 100644 index 0000000000..bd864a6407 --- /dev/null +++ b/bacula/examples/autochangers/chio-bacula @@ -0,0 +1,138 @@ +#!/bin/sh +# +# Bacula interface to mtx autoloader +# (By Lars Koeller, lars+bacula@koellers.net) +# +# If you set in your Device resource +# +# Changer Command = "path-to-this-script/chio-bacula" %c %o %S %a +# you will have the following input to this script: +# +# chio-bacula "changer-device" "command" "slot" "archive-device" +# +# for example: +# +# chio-bacula /dev/sg0 load 1 /dev/nst0 (on a FreeBSD system) +# +# If you need to to an offline, refer to the drive as $4 +# e.g. mt -f $f offline +# +# Many changers need an offline after the unload. Also many +# changers need a sleep 60 after the mtx load. +# +# N.B. If you change the script, take care to return either +# the mtx exit code or a 0. If the script exits with a non-zero +# exit code, Bacula will assume the request failed. +# + +# This simulates a barcode reader in the changer. +# The labes of the virtual barcode reader are located in the BARCODE_FILE +SIMULATE_BARCODE=true +BARCODE_FILE=/usr/local/etc/bacula-barcodes + +me=$(basename $0) + +# Debug +echo "$me $@" > /dev/console + +if [ -z "$1" ] ; then + usage; +fi + +if [ -z "$2" ] ; then + usage; +fi + +MTX=/bin/chio +CHANGER=$1 +COMMAND=$2 +if [ ! -z "$3" ]; then + SLOT=$3 +fi +if [ ! -z "$4" ]; then + TAPE=$4 +else + TAPE=/dev/nrsa2 +fi + +# Time to wait for loading +SLEEP=20 +# What drive of the autochanger should be used primary +# At the moment bacula (1.31a) could not deal with more drives +DRIVE=1 + +usage() +{ + echo "" + echo "The $me script for bacula" + echo "--------------------------------------" + echo "" + echo "usage: $me [slot] [devicename of tapedrive]" + echo "" + echo "Valid commands:" + echo "" + echo "unload Unloads a tape into the slot" + echo " from where it was loaded." + echo "load Loads a tape from the slot " + echo " (slot-base is calculated to 1 as first slot)" + echo "list Lists full storage slots" + echo "loaded Gives slot from where the tape was loaded." + echo " 0 means the tape drive is empty." + echo "slots Gives Number of aviable slots." + echo "" + echo "Example:" + echo " mtx-changer /dev/changer load 1 loads a tape from slot 1" + echo "" + exit 2 +} + + +case ${COMMAND} in + unload) + # enable the following line if you need to eject the cartridge + #mt -f ${TAPE} off + #sleep 2 + ${MTX} -f ${CHANGER} return drive ${DRIVE} + ;; + + load) + ${MTX} -f ${CHANGER} move slot $((${SLOT}-1)) drive ${DRIVE} + rtn=$? + # Increase the sleep time if you have a slow device + sleep $SLEEP + exit $rtn + ;; + + list) + if [ "${SIMULATE_BARCODE}" = "true" ]; then + if [ -f "$BARCODE_FILE" ]; then + cat $BARCODE_FILE | grep -v "^#" + exit 0 + else + echo "Barcode file $BARCODE_FILE missing ... exiting!" + exit 1 + fi + else + ${MTX} -f ${CHANGER} status | grep "^slot .*: .*FULL>" | awk '{print $2}' | awk -F: '{print $1+1" "}' | tr -d "[\r\n]" + fi + ;; + + loaded) + # echo "Request loaded" + ${MTX} -f ${CHANGER} status -S > /tmp/mtx.$$ + rtn=$? + cat /tmp/mtx.$$ | grep "^drive ${DRIVE}: " | awk '{print $6+1}' | tr -d ">" + cat /tmp/mtx.$$ | grep "^drive ${DRIVE}: source: <>" | awk "{print 0}" + rm -f /tmp/mtx.$$ + exit $rtn + ;; + + slots) + # echo "Request slots" + ${MTX} -f ${CHANGER} status | grep "^slot " | tail -1 | awk '{print $2+1}' | tr -d ":" + ;; + + *) + usage + ;; +esac diff --git a/bacula/examples/autochangers/chio-changer b/bacula/examples/autochangers/chio-changer new file mode 100644 index 0000000000..5437cba65f --- /dev/null +++ b/bacula/examples/autochangers/chio-changer @@ -0,0 +1,125 @@ +#!/bin/sh +# +# Bacula interface to autoloader +# +# By Pascal Pederiva +# +# Known to work on FreeBSD 5.2 with a TZ875 changer. +# +# This script mimics mtx-changer with the following differences +# - it automatically stows the cartridge to the slot it came from when +# unloading. +# - a load will automatically unload the drive if there is a + different cartridge loaded. +# - it uses chio instead of mtx (which is + available as a package) +# +# If you set in your Device resource +# +# Changer Command = "path-to-this-script/chio-changer" %c %o %S %a +# you will have the following input to this script: +# +# chio-changer "changer-device" "command" "slot" "archive-device" +# +# for example: +# +# chio-changer /dev/sg0 load 1 /dev/nst0 (on a Linux system) +# +# If you need to to an offline, refer to the drive as $4 +# e.g. mt -f $4 offline +# +# Many changers need an offline after the unload. Also many +# changers need a sleep 60 after the chio load. +# +# N.B. If you change the script, take care to return either +# the chio exit code or a 0. If the script exits with a non-zero +# exit code, Bacula will assume the request failed. +# +# Examples: +# chio-changer load 1 ; load slot 1 into drive 0 (and unload old cartridge if necessary) +# chio-changer unload N ; unload drive into source slot (slot number is ignored) +# chio-changer loaded N ; Return loaded slot # +# chio-changer /dev/ch0 loaded N /dev/nsa0 ; has the same effect + + +#echo `date` "chio: $*" >>/tmp/changer + +# If the first parameter is not a device, assume it is a command +# and you want to use the default changer + +if [ -c $1 ]; then + CHANGER=$1 + shift +else + CHANGER=/dev/ch0 +fi + +COMMAND=$1 +ELEMENT=$2 +DRIVE=$3 + +MTX=chio + +############################################################################## + +case "$COMMAND" in + unload) + +# enable the following line if you need to eject the cartridge +# mt -f $DRIVE offline + SOURCE=`${MTX} status -S | grep drive | grep FULL | cut -d: -f 3 | tr -d '<>a-z '` + if [ ! -z "$SOURCE" ]; then + echo -n "Unloading Data Transfer Element into Storage Element $ELEMENT..." + ${MTX} -f $CHANGER move drive 0 slot $SOURCE + rtn=$? + echo "done" + else + echo "Storage Element $ELEMENT is Already Full" + fi + exit $rtn + ;; + + load) + if [ -z "$ELEMENT" ]; then + echo "ERROR: load reguired" + return 1 + fi + TARGET=$ELEMENT + if [ $TARGET -le 0 ]; then + TARGET=1 + fi + TARGET=`expr $TARGET - 1` + + SOURCE=`${MTX} status -S | grep drive | grep FULL | cut -d: -f 3 | tr -d '<>a-z '` + if [ ! -z "$SOURCE" ]; then + if [ "$SOURCE" != "$TARGET" ]; then + # Only unload if there is something different in the drive + ${MTX} -f $CHANGER move drive 0 slot $SOURCE + fi + fi + + if [ "$SOURCE" != "$TARGET" ]; then + ${MTX} -f $CHANGER move slot $TARGET drive 0 + rtn=$? + fi + exit $rtn + ;; + + list) + ${MTX} -f $CHANGER status slot | grep "FULL" | awk '{print $2+1":"}' + ;; + + loaded) + SOURCE=`${MTX} status -S | grep drive | grep FULL | cut -d: -f 3 | tr -d '<>a-z '` + rtn=$? + if [ -z "$SOURCE" ]; then + SOURCE=-1 + fi + echo `expr 1 + ${SOURCE}` + exit $rtn + ;; + + slots) + ${MTX} -f $CHANGER status slot | wc -l + ;; +esac diff --git a/bacula/examples/autochangers/mtx-changer.Adic-Scalar-100 b/bacula/examples/autochangers/mtx-changer.Adic-Scalar-100 new file mode 100755 index 0000000000..8c09ba3c3d --- /dev/null +++ b/bacula/examples/autochangers/mtx-changer.Adic-Scalar-100 @@ -0,0 +1,1180 @@ +From bacula-users-admin@lists.sourceforge.net Wed Dec 10 15:04:47 2003 +Return-Path: +Received: from sc8-sf-mx1.sourceforge.net (lists.sourceforge.net + [66.35.250.206]) by matou.sibbald.com (8.11.6/8.11.6) with ESMTP id + hBAE4lY32735 for ; Wed, 10 Dec 2003 15:04:47 +0100 +Received: from sc8-sf-list2-b.sourceforge.net ([10.3.1.8] + helo=sc8-sf-list2.sourceforge.net) by sc8-sf-mx1.sourceforge.net with esmtp + (TLSv1:AES256-SHA:256) (Exim 4.24) id 1AU4wc-0007gs-Ls; Wed, 10 Dec 2003 + 06:04:02 -0800 +Received: from localhost.localdomain ([127.0.0.1] + helo=projects.sourceforge.net) by sc8-sf-list2.sourceforge.net with esmtp + (Exim 4.24) id 1AU4wc-0006AC-FQ; Wed, 10 Dec 2003 06:04:02 -0800 +Received: from sc8-sf-mx2-b.sourceforge.net ([10.3.1.12] + helo=sc8-sf-mx2.sourceforge.net) by sc8-sf-list2.sourceforge.net with esmtp + (Exim 4.24) id 1AU4vz-00068m-GL for bacula-users@lists.sourceforge.net; + Wed, 10 Dec 2003 06:03:23 -0800 +Received: from mta2.navair.navy.mil ([192.58.199.164]) by + sc8-sf-mx2.sourceforge.net with esmtp (Exim 4.24) id 1AU4vy-0006U5-2Q for + bacula-users@lists.sourceforge.net; Wed, 10 Dec 2003 06:03:22 -0800 +Received: by mta2.navair.navy.mil (Postfix, from userid 0) id EEB0B16C1FD; + Wed, 10 Dec 2003 09:03:10 -0500 (EST) +Received: from neim02.nawcad.navy.mil (neim02.nawcad.navy.mil + [140.229.37.205]) by mta2.navair.navy.mil (Postfix) with ESMTP id + 64D5116C2A9; Wed, 10 Dec 2003 09:03:10 -0500 (EST) +Received: by neim02.nawcad.navy.mil with Internet Mail Service + (5.5.2657.72) id ; Wed, 10 Dec 2003 09:02:18 -0500 +Message-ID: +From: "Kirkpatrick, Drew (ARINC)" +To: "'terry@mrtux.co.uk'" , bacula-users@lists.sourceforge.net +Subject: RE: [Bacula-users] Re: Autochanger setup +MIME-Version: 1.0 +X-Mailer: Internet Mail Service (5.5.2657.72) +Content-Type: text/plain; charset="ISO-8859-1" +X-Spam-Score: 0.0 (/) +X-Spam-Report: Spam Filtering performed by sourceforge.net. See + http://spamassassin.org/tag/ for more details. Report problems to + https://sf.net/tracker/?func=add&group_id=1&atid=200001 0.0 CLICK_BELOW + Asks you to click below +Sender: bacula-users-admin@lists.sourceforge.net +Errors-To: bacula-users-admin@lists.sourceforge.net +X-BeenThere: bacula-users@lists.sourceforge.net +X-Mailman-Version: 2.0.9-sf.net +Precedence: bulk +List-Unsubscribe: + , + +List-Id: Bacula user's email list for support and discussions + +List-Post: +List-Help: +List-Subscribe: + , + +List-Archive: + +Date: Wed, 10 Dec 2003 09:02:14 -0500 +X-Spam-Score: 0.0 (/) +X-Spam-Report: Spam Filtering performed by sourceforge.net. See + http://spamassassin.org/tag/ for more details. Report problems to + https://sf.net/tracker/?func=add&group_id=1&atid=200001 0.0 CLICK_BELOW + Asks you to click below +Status: RO +X-Status: F +X-Keywords: +X-UID: 76 +Content-Transfer-Encoding: 8bit + +So far this seems to be working for me, but it's not all quite finished :) + +Device { + Name = "firstTapeDrive" + Media Type = AIT3 + Archive Device = /dev/nst0 + Changer Device = /dev/sg3 + Changer Command = "/etc/bacula/mtx-changer %c %o %S %a" + AutoChanger = yes + Backward Space Record = no + RemovableMedia = yes + AlwaysOpen = yes + AutomaticMount = yes + LabelMedia = no +# HardwareEndOfMedium = no +} + + + +And here's the current version of my mtx-changer script (which changes +frequently as I figure out more of this stuff) + +**************************************************************************** +********************** + +#!/bin/bash + +# mtx-changer script modded to work with a Adic Scalar 100 better +# Drew Kirkpatrick, kirkpatricda@navair.navy.mil + + +echo "mtx-change called with: "$@ + + +AUTOLOADERDEV=$1 +DRIVE=0 +DRIVE_0_SEARCH="Data Transfer Element 0" +DRIVE_1_SEARCH="Data Transfer Element 1" +MTX=/usr/local/sbin/mtx + + + + +######################### Functions + + + + +# Take a single argument, a barcode number +# and returns the slot in which said tape +# should reside according to the +# tapeSlotMap file. That file is +# created using the setTapeSlotMap +# script +getSlotNum() +{ + if [ -z "$1" ] + then + echo getSlotNum"() called" \ + "without a parameter, error!!!" + exit 1 + fi + +# makes sure there is an entry in .tapeSlotMap file +# for that barcode number + found=`grep "$1" /etc/bacula/.tapeSlotMap | wc -l | awk '{print $1}'` + + if [ "$found" -ne 1 ] + then + echo "FATAL ERROR, in getSlotNum($1), error looking up" + echo "that barcode number. Found ($found) instances in the" + echo "tapeSlotMap file. There should be 1 instance. Do you" + echo "need to update this file with setTapeSlotMap script???" + exit 1 + fi + + slotNum=`grep "$1" /etc/bacula/.tapeSlotMap | awk '{print $1}'` + return $slotNum +} + + + + + + +# Take 1 arg, a 0 or 1 (or, how about the DRIVE var: ) +# for the drive it is interested in +# returns 1 if that drive has a tape loaded, and 0 if not +doesDriveGottaTape() +{ + if [ -z "$1" ] + then + echo "doesDriveGottaTape() called" \ + "without a parameter, error fool!!!" + exit 1 + else + case "$1" in + 0 ) + ANSWER=`${MTX} -f $AUTOLOADERDEV status | grep +"$DRIVE_0_SEARCH" \ + | awk '{sub("0:",""); print $4}'` + ;; + 1 ) + ANSWER=`${MTX} -f $AUTOLOADERDEV status | grep +"$DRIVE_1_SEARCH" \ + | awk '{sub("1:",""); print $4}'` + ;; + * ) + echo "Invalid drive num passed to +doesDriveGottaTape($1)" + exit 1 + ;; + esac + fi + + case "$ANSWER" in + Full ) + return 1 + ;; + Empty ) + return 0 + ;; + * ) + echo "Fatal error, invalid answer in doesDriveGottaTape(), +$ANSWER" + exit 1 + ;; + esac +} + + + + + + +# This handles 'correctly' unloading a drive to make sure it ends up +# in the slot it originaly came from. If you're moving/adding tapes +# please check the setTapeSlotMap script, and use accordingly +# to update the barcode->slot mappings. +# This function is needed because the Adic Scalar 100 +# doesn't seem to like returning a tape to it's original slot +# everytime. It seems to pick the first available, and I can't +# seem to figure out how to make it stop doing this. +# oh, and it takes 1 arg, the drive to unload +unloadDrive() +{ + if [ -z "$1" ] + then + echo "unloadDrive() called " \ + "without a parameter, error!!!" + exit 1 + fi + + +# double check to see if that drive does actually have a tape in it + doesDriveGottaTape "$1" + rtn=$? + if [ "$rtn" == 0 ] + then + echo "errrm, in unloadDrive($1), that drive " \ + "doesn't have a tape in it!!!" + return 0 + fi + + +# Get the barcode of the tape in the drive + case "$1" in + 0 ) + barcode=`${MTX} -f $AUTOLOADERDEV status | grep +"$DRIVE_0_SEARCH" | awk '{print $10}'` + ;; + 1 ) + barcode=`${MTX} -f $AUTOLOADERDEV status | grep +"$DRIVE_1_SEARCH" | awk '{print $10}'` + ;; + * ) + echo "ERROR, invalid drive num in unloadDrive($1)" + exit 1 + ;; + esac + +# return tape with barcode to which slot??? + getSlotNum "$barcode" + returnTo=$? + + +# unloading the tape now + ${MTX} -f $AUTOLOADERDEV unload $returnTo $1 + rtn=$? + if [ "$rtn" -ne 0 ] + then + echo "MTX came back with code ($rtn)" + echo "ERROR, in unloadDrive($1), mtx unload failed" + exit 1 + fi + return $rtn +} + + + + +# This handles loading tapes into drives +# It checks if there is currently a tape +# in the target drive, and if there is +# it unloads it prior to loading the new tape +# just in case bacula doesn't explicitly +# request this. +# This function take two args, the drive +# to load, and the tape slot to load from +loadDrive() +{ + if [ -z "$1" ] || [ -z "$2" ] + then + echo "loadDrive() not called " \ + "with the correct params, error!!!" + exit 1 + fi + +# Check to see if it already has a tape in it... + doesDriveGottaTape "$1" + rtn=$? + if [ "$rtn" == 1 ] + then + echo "Oops, in loadDrive() that drive" + echo "already has a tape. Unloading it now" + unloadDrive "$1" + fi + + +# You're now ready to load the drive + echo "Now loading tape in slot $2 into drive $1" + + ${MTX} -f $AUTOLOADERDEV load $2 $1 + rtn=$? + if [ "$rtn" -ne 0 ] + then + echo "MTX came back with code ($rtn)" + echo "ERROR, in loadDrive($1, $2), mtx load failed" + exit 1 + fi + return $rtn +} + + + + + +####################### End Functions + + + + +####################### Start Script + +# Changes the nst* device bacula passes to a number that mtx likes +if [ "$2" == load ] || [ "$2" == unload ] +then + echo "In mtx-changer drive selection code...." + case "$4" in + /dev/nst0 ) + DRIVE="0" + ;; + + /dev/nst1 ) + DRIVE="1" + ;; + + * ) + echo "Error, invalid drive for autoloader." + echo "Maybe you mispelled the drive name, or tried to" + echo "use a drive that doesn't exist" + echo "Only two drives handled in /etc/bacula/mtx-changer script" + exit 1 + ;; + esac +fi + + + + +case "$2" in + unload) + unloadDrive "$DRIVE" + rtn=$? + + sleep 35 + exit $rtn + ;; + + load) + loadDrive "$DRIVE" "$3" + rtn=$? + sleep 55 + exit $rtn + ;; + + list) + echo "Requested list, DREW YOU HAVEN'T IMPLEMENTED YET!!!!" + ${MTX} -f $1 status | grep " *Storage Element [0-9]*:.*Full" | \ + awk "{print \$3 \$4}" | sed "s/Full *\(:VolumeTag=\)*//" + + rtn=$? + echo "mtx-changer returning value: $rtn" + ;; + + loaded) + echo "Request loaded, DREW YOU HAVEN'T IMPLEMENTED YET!!!!" + ${MTX} -f $1 status >/tmp/mtx.$$ + rtn=$? + cat /tmp/mtx.$$ | grep "^Data Transfer Element 0:Full" | awk "{print +\$7}" + cat /tmp/mtx.$$ | grep "^Data Transfer Element 0:Empty" | awk "{print +0}" +# cat /tmp/mtx.$$ | grep "^Data Transfer Element 1:Full" | awk "{print +\$7}" +# cat /tmp/mtx.$$ | grep "^Data Transfer Element 1:Empty" | awk +"{print 0}" + rm -f /tmp/mtx.$$ + + echo "mtx-changer returning value: $rtn" + exit $rtn + ;; + + slots) + echo "Request slots, DREW YOU HAVEN'T IMPLEMENTED YET!!!!" + ${MTX} -f $1 status | grep " *Storage Changer" | awk "{print \$5}" + rtn=$? + echo "mtx-changer returning value: $rtn" + ;; +esac + + +**************************************************************************** +** + + + + + +Hope that helps. Sorry, it's kinda setup for our Adic, and for two drives. + + + +-Drew + + +-----Original Message----- +From: Terry [mailto:terry@mrtux.co.uk] +Sent: Wednesday, December 10, 2003 8:23 AM +To: bacula-users@lists.sourceforge.net +Subject: [Bacula-users] Re: Autochanger setup + + +bacula-users-request@lists.sourceforge.net wrote: + +>Send Bacula-users mailing list submissions to +> bacula-users@lists.sourceforge.net +> +>To subscribe or unsubscribe via the World Wide Web, visit +> https://lists.sourceforge.net/lists/listinfo/bacula-users +>or, via email, send a message with subject or body 'help' to +> bacula-users-request@lists.sourceforge.net +> +>You can reach the person managing the list at +> bacula-users-admin@lists.sourceforge.net +> +>When replying, please edit your Subject line so it is more specific +>than "Re: Contents of Bacula-users digest..." +> +> +>Today's Topics: +> +> 1. Two beta releases (Kern Sibbald) +> 2. Re: Current Volume "Cinta-0006" not acceptable +> because (Kern Sibbald) +> 3. Re: Jobs awaiting execution? (Kern Sibbald) +> 4. Re: Mount need for every job... me too (Gregory Brauer) +> 5. Importtant: BIG Problems with schedule / bacula doesn't do +Differnetial +> backups (Volker Sauer) +> 6. Re: Mount need for every job... me too (fixed!) (Gregory Brauer) +> +>--__--__-- +> +>Message: 1 +>From: Kern Sibbald +>To: bacula-announce +>Cc: bacula-users +>Organization: +>Date: 09 Dec 2003 22:11:47 +0100 +>Subject: [Bacula-users] Two beta releases +> +>Hello, +> +>I have just made two Beta releases. Unfortunately, I mistakenly put the +>1.32e-08Dec03 Windows binaries in main win-binaries section rather than +>win-binaries-beta. At this point, I won't change it because it would +>require a new upload, ... +> +>The 1.33-08Dec03 release is definitely a Beta release in the sense that +>version 1.33 is still under very active development. The main features +>of this release are: +>- all features in 1.32e-08Dec03 +>- update slots (marks any other Volumes in the same pool with the same +> Slot number as "not InChanger"). This permits retaining the Slot on +> Volumes not currently in the magazine. +>- update slots=,,, ... +> where slot1, slot2 are slot numbers you want updated from barcode +> information and slot-range is a slot-number1-slot-number2 (e.g. 3-5). +>- update slots[=...] scan +> causes the Storage daemon to read the volume label for each slot +> listed, or in the absence of a slot list, all slots occupied. +>- Automatic synchronization of clocks between DIR and FD so that there +> is no missed files due to timezone differences or shewed clocks. +>- A database upgrade is mandatory. +>- None of the daemons are compatible with version 1.32x, which means +> you must upgrade all or nothing. +>- NOTE! FreeBSD users must add: +> Two EOF = yes +> to each of their tape Device resources in the SD. I forgot to document +> this elsewhere!!!!! +> +>Release 1.32e-08Dec03 was meant to be an official 1.32e release with all +>the current patches and a few strategic updates from 1.33. In the end, I +>threw in *all* the updates from 1.33 except those that require a +>database upgrade or force a daemon incompatibility, or other operating +>incompatibility. +> +>I haven't made 1.32-08Dec03 an official release for three reasons: +>- I cannot test it in production because my production system is on +> release 1.33. +>- There is still a bit more documentation to do. +>- I added more of the 1.33 code than I originally planned, but some of +> it such as the new 10 job history for each daemon is so neat that I +> wanted to put it in your hands (one of the features not yet +> documented). +> +>That said, I think this is a very good release. I have HEAVILY tested it +>with my regression testing, and 95% of the code has been running in my +>production 1.33 system since 24 November. I encourage all of you to +>test it. Note, all of the daemons should be totally compatible with any +>other 1.32x release -- please send feedback. +> +>Once I finish the documentation and get some feedback on how it runs, +>I'll "officially" release it. +> +>As most of you know, from tomorrow morning, I will be out for one week +>and then a bit slow responding for a week or two. Thanks for all the +>well wishes I have received. +> +>Regards, Kern +> +> +> +> +> +> +>--__--__-- +> +>Message: 2 +>Subject: Re: [Bacula-users] Current Volume "Cinta-0006" not acceptable +> because +>From: Kern Sibbald +>To: Carlos Molina Molina +>Cc: Phil Stracchino , +> bacula-users +>Organization: +>Date: 09 Dec 2003 22:30:07 +0100 +> +> +>--=-HANNTFvbGW9Q5KQ00dee +>Content-Type: text/plain; charset=ISO-8859-1 +>Content-Transfer-Encoding: quoted-printable +> +>On Tue, 2003-12-09 at 19:03, Carlos Molina Molina wrote: +> +> +>>no, I haven't the volume.... but the only thing that I need from bacula i= +>> +>> +>t's=20 +> +> +>>that write in any volume +>>other thing it's that when finish it send this part of messages. I put "u= +>> +>> +>se=20 +> +> +>>any volume" +>>=20 +>>AZOG: Naboo-Backup.2003-12-09_14.12.07 Warning: Unexpected Client Job=20 +>>message: 2801 End Backup Job TermCode=3D84 JobFiles=3D56064 ReadBytes=3D1= +>> +>> +>501707569=20 +> +> +>>JobBytes=3D621946654 +>>=20 +>>AZOG: Naboo-Backup.2003-12-09_14.12.07 Fatal error: No Job status returne= +>> +>> +>d=20 +> +> +>>from FD. +>>=20 +>>What means??? +>> +>> +> +>I cannot comment on the tape Volume error messages, but the message +>listed above "Unexpected Client Job message ..." seems to me to come +>from the fact that you have upgraded that client (File daemon) to a more +>recent version of Bacula than you are running on your Director. Please +>check your version numbers. If they are both the same number they should +>work together. If not, you need to get them both on the same version. +> +>Be sure to read the ReleaseNotes on any upgrade to ensure you do any +>required database upgrading. +> +>Regards, Kern +> +> +> +> +>>Thank +>>=20 +>> +>> +>>>From: Phil Stracchino +>>>To: bacula-users@lists.sourceforge.net +>>>Subject: Re: [Bacula-users] Current Volume "Cinta-0006" not acceptable=20 +>>>because +>>>Date: Tue, 9 Dec 2003 12:56:43 -0500 +>>> +>>>On Tue, Dec 09, 2003 at 03:47:29PM +0000, Carlos Molina Molina wrote: +>>> +>>> +>>>>How I avoid this message???, The only solution it's that I erase the=20 +>>>> +>>>> +>>>tape +>>> +>>> +>>>>manually... +>>>> +>>>> +>>>>SDT-10000: Naboo-Backup.2003-12-09_12.38.04 Warning: mount.c:232=20 +>>>> +>>>> +>>>Director +>>> +>>> +>>>>wanted Volume "Cinta-0001". +>>>> Current Volume "Cinta-0006" not acceptable because: +>>>> 1997 Volume "Cinta-0006" not in catalog. +>>>>SDT-10000: Please mount Volume "Cinta-0001" on Storage Device=20 +>>>> +>>>> +>>>"SDT-10000" +>>> +>>> +>>>>for Job Naboo-Backup.2003-12-09_12.38.04 +>>>>Use "mount" command to release Job. +>>>> +>>>> +>>>Don't you have the volume it's asking for? +>>> +>>> +>>>-- +>>> .********* Fight Back! It may not be just YOUR life at risk. =20 +>>>*********. +>>> : phil stracchino : unix ronin : renaissance man : mystic zen biker ge= +>>> +>>> +>ek=20 +> +> +>>>: +>>> : alaric@caerllewys.net : alaric-ruthven@earthlink.net : phil@latt.ne= +>>> +>>> +>t =20 +> +> +>>>: +>>> : 2000 CBR929RR, 1991 VFR750F3 (foully murdered), 1986 VF500F (sold)= +>>> +>>> +> =20 +> +> +>>>: +>>> : Linux Now! ...Because friends don't let friends use Microsoft. = +>>> +>>> +> =20 +> +> +>>>: +>>> +>>> +>>>------------------------------------------------------- +>>>This SF.net email is sponsored by: SF.net Giveback Program. +>>>Does SourceForge.net help you be more productive? Does it +>>>help you create better code? SHARE THE LOVE, and help us help +>>>YOU! Click Here: http://sourceforge.net/donate/ +>>>_______________________________________________ +>>>Bacula-users mailing list +>>>Bacula-users@lists.sourceforge.net +>>>https://lists.sourceforge.net/lists/listinfo/bacula-users +>>> +>>> +>>=20 +>>_________________________________________________________________ +>>MSN Amor: busca tu =BD naranja http://latam.msn.com/amor/ +>>=20 +>>=20 +>>=20 +>>------------------------------------------------------- +>>This SF.net email is sponsored by: SF.net Giveback Program. +>>Does SourceForge.net help you be more productive? Does it +>>help you create better code? SHARE THE LOVE, and help us help +>>YOU! Click Here: http://sourceforge.net/donate/ +>>_______________________________________________ +>>Bacula-users mailing list +>>Bacula-users@lists.sourceforge.net +>>https://lists.sourceforge.net/lists/listinfo/bacula-users +>> +>> +> +>--=-HANNTFvbGW9Q5KQ00dee +>Content-Type: application/pgp-signature; name=signature.asc +>Content-Description: This is a digitally signed message part +> +>-----BEGIN PGP SIGNATURE----- +>Version: GnuPG v1.2.1 (GNU/Linux) +> +>iD8DBQA/1j7fNgfoSvWqwEgRAsEDAJ0aF6qvQVHiH0X4DCTwXQh3wux1gACfQLxl +>wKgzEjDQMg3v1vh4yS6kUys= +>=6xcc +>-----END PGP SIGNATURE----- +> +>--=-HANNTFvbGW9Q5KQ00dee-- +> +> +> +>--__--__-- +> +>Message: 3 +>Subject: Re: [Bacula-users] Jobs awaiting execution? +>From: Kern Sibbald +>To: Danie Theron +>Cc: bacula-users +>Organization: +>Date: 09 Dec 2003 22:39:39 +0100 +> +>Hello, +> +>Move up to version 1.32d or 1.32e. The job scheduler was totally +>rewritten between 1.31 and 1.32 and a number of bizarre little problems +>that some people (not me) were having totally went away. I suspect that +>they were pthreads related on non-Linux systems, but who knows ... +> +>Regards, Kern +> +>On Tue, 2003-12-09 at 12:09, Danie Theron wrote: +> +> +>>Hi +>> +>>I have recently split my backups into more manageable sets , and now it +>>seems they are not running automatically. Here is an output when I do a +>>"status" command : +>> +>>Last Job BackupCatalog.2003-12-09_01.10.00 finished at 09-Dec-2003 01:10 +>> Files=1 Bytes=43,308,017 Termination Status=OK +>>Console connected at 09-Dec-2003 19:06 +>>JobId 132 Job prometheus-rapstech.2003-12-09_19.00.03 is waiting +>>execution. +>>JobId 131 Job prometheus-consult-gis.2003-12-09_19.00.02 is waiting +>>execution. +>>JobId 130 Job prometheus-consult-documents.2003-12-09_19.00.01 is +>>waiting on max +>> Client jobs. +>>JobId 129 Job prometheus-system.2003-12-09_19.00.00 is running. +>>Level Type Scheduled Name +>>================================================================= +>>Incremental Backup 10-Dec-2003 19:00 prometheus-system +>>Incremental Backup 10-Dec-2003 19:00 prometheus-consult-documents +>>Incremental Backup 10-Dec-2003 19:00 prometheus-consult-gis +>>Incremental Backup 10-Dec-2003 19:00 prometheus-rapstech +>>Full Backup 10-Dec-2003 01:10 BackupCatalog +>>==== +>>Connecting to Storage daemon File at localhost:9103 +>> +>>prometheus-sd Version: 1.31a (02 Aug 2003) +>>Daemon started 08-Dec-2003 19:30, 3 Jobs run. +>>Last Job BackupCatalog.2003-12-09_01.10.00 finished at 09-Dec-2003 01:10 +>> Files=1 Bytes=43,308,119 Termination Status=OK +>>Device /data/server is mounted with Volume "backup" +>> Total Bytes=791,751,921 Blocks=12,274 Bytes/block=64,506 +>> Positioned at File=0 Block=9,351 +>>Device /data/server is not open. +>>Device /data/server is not open. +>>Device /data/server is not open. +>>Device /data/server is not open. +>>Full Backup job backup using Volume +>>"prometheus-system.2003-12-09_19.00.00" on d +>>evice /data/server +>> Files=15,341 Bytes=602,255,638 Bytes/sec=1,517,016 +>> FDReadSeqNo=134,036 in_msg=96746 out_msg=5 fd=6 +>> +>> +>>When I manually run a job it backups fine. +>> +>>Ta in advance +>>Daniel +>> +>> +>> +>>------------------------------------------------------- +>>This SF.net email is sponsored by: SF.net Giveback Program. +>>Does SourceForge.net help you be more productive? Does it +>>help you create better code? SHARE THE LOVE, and help us help +>>YOU! Click Here: http://sourceforge.net/donate/ +>>_______________________________________________ +>>Bacula-users mailing list +>>Bacula-users@lists.sourceforge.net +>>https://lists.sourceforge.net/lists/listinfo/bacula-users +>> +>> +> +> +> +>--__--__-- +> +>Message: 4 +>Date: Tue, 09 Dec 2003 14:57:32 -0800 +>From: Gregory Brauer +>To: bacula-users +>Subject: Re: [Bacula-users] Mount need for every job... me too +> +> +>I have looked at all of the comments in this thread, but I +>am also having this problem and cannot seem to fix it. +>I am using an autochanger that blocks waiting for me to type +>the "mount" command every time it autoloads a tape. It +>worked fine for me with 1.31, but has been doing this +>since I upgraded to 1.32d. Here are some excerpts from my +>configuration: +> +> +> From bacula-dir.conf: +> +>Storage { +> Autochanger = yes +> Name = "kiev AIT2 Autoloader" +> Address = kiev +> SDPort = 9103 +> Password = "yV3C5gZXhF/RrYadlwKWnwAbTV1oUCXVqUIrAaUjMov+" +> Device = "AIT2 Autoloader" +> MediaType = "AIT2" +>} +> +> +> From bacula-sd.conf: +> +>Device { +> Autochanger = yes +> Changer Device = /dev/sg0 +> Changer Command = "/etc/bacula/mtx-changer %c %o %S %a" +> Name = "AIT2 Autoloader" +> Media Type = "AIT2" +> Archive Device = /dev/nst0 +> Hardware end of medium = No; +> Automatic Mount = yes; +> Always Open = yes; +> Removable Media = yes; +>} +> +>I had tried this with both Always Open = yes, and no... it worked fine +>with "no" under 1.31. +> +> +>I have also noticed that every time bacula issues a "load slot" command, +>I get an error message saying mtx-changer exited 1. +> +> +>09-Dec-2003 14:42 kiev-sd: 3303 Issuing autochanger "load slot 15" command. +>09-Dec-2003 14:44 kiev-sd: 3992 Bad autochanger "load slot" status=1. +> +> +>But if I run mtx-changer manually from the command line, it always +>seems to exit 0, so I'm not sure where bacula is seeing this error. +> +> +>basic [root@kiev bacula]$ ./mtx-changer /dev/sg0 load 15 /dev/nst0 +>basic [root@kiev bacula]$ echo $status +>0 +> +> +>I have tried increasing my sleep time on load to arbitrarily high +>values, but that hasn't helped. +> +> +> load) +># echo "Doing mtx -f $1 load $3" +> ${MTX} -f $1 load $3 +> rtn=$? +># +># Increase the sleep time if you have a slow device +> #sleep 15 +> sleep 120 +> exit $rtn +> ;; +> +> +>What else can I check? +> +>Greg +> +> +> +>--__--__-- +> +>Message: 5 +>Date: Wed, 10 Dec 2003 00:48:19 +0100 +>From: Volker Sauer +>To: Kern Sibbald , +> bacula-users +>Subject: [Bacula-users] Importtant: BIG Problems with schedule / bacula +doesn't do Differnetial +> backups +> +>This is an OpenPGP/MIME signed message (RFC 2440 and 3156) +>--------------enig1AEBD91EBCB59C2EB43FEF98 +>Content-Type: text/plain; charset=us-ascii; format=flowed +>Content-Transfer-Encoding: 7bit +> +>Hallo Kern, +> +>as I already worried about in 2 other mails is now proven: +> +>Bacula doesn't do a diffential backup! +> +>My schedule is this: +> +>Schedule { +> Name = "WeeklyCycle" +> Run = Level=Full Pool=Full 1st tue at 2:00pm +> Run = Level=Differential Pool=Full 2nd-5th tue at 7:00pm +> Run = Level=Incremental Pool=Inc wed-mon at 7:00pm +>} +> +> +>and this is what list jobs says (I hope you can read that): +> +> +>| 55 | Zaphod | 2003-12-02 14:00:04 | B | F | +>504,634 | 20,669,282,940 | T | +>| 56 | Arthur | 2003-12-02 16:31:30 | B | F | +>380,719 | 15,498,385,751 | T | +>| 57 | Alexis | 2003-12-02 18:23:45 | B | F | +>167,710 | 5,157,651,432 | T | +>| 58 | BackupCatalog | 2003-12-02 19:23:13 | B | F | +> 1 | 404,663,640 | T | +>| 59 | ReminderIncCartridge | 2003-12-03 08:00:05 | D | F | +> 0 | 0 | T | +>| 60 | Zaphod | 2003-12-03 19:00:04 | B | I | +> 693 | 262,166,208 | T | +>| 61 | Arthur | 2003-12-03 19:12:57 | B | I | +> 314 | 889,290,521 | T | +>| 62 | Alexis | 2003-12-03 19:24:46 | B | I | +> 748 | 56,013,471 | T | +>| 63 | BackupCatalog | 2003-12-03 22:00:04 | B | F | +> 1 | 404,846,132 | T | +>| 64 | Zaphod | 2003-12-04 19:00:05 | B | I | +> 740 | 385,140,941 | T | +>| 65 | Arthur | 2003-12-04 19:16:03 | B | I | +> 441 | 904,698,439 | T | +>| 66 | Alexis | 2003-12-04 19:28:09 | B | I | +> 669 | 68,876,161 | T | +>| 67 | BackupCatalog | 2003-12-04 22:00:04 | B | F | +> 1 | 253,231,104 | E | +>| 68 | BackupCatalog | 0000-00-00 00:00:00 | B | I | +> 0 | 0 | C | +>| 69 | BackupCatalog | 0000-00-00 00:00:00 | B | I | +> 0 | 0 | C | +>| 70 | BackupCatalog | 2003-12-05 01:25:19 | B | I | +> 1 | 405,045,253 | T | +>| 71 | Zaphod | 2003-12-05 19:00:04 | B | I | +> 8,389 | 373,643,708 | T | +>| 72 | Arthur | 2003-12-05 19:13:59 | B | I | +> 6,904 | 1,007,785,097 | T | +>| 73 | Alexis | 2003-12-05 19:28:23 | B | I | +> 4,085 | 114,727,583 | T | +>| 74 | BackupCatalog | 2003-12-05 22:00:04 | B | F | +> 1 | 407,222,289 | T | +>| 75 | Zaphod | 2003-12-06 19:00:05 | B | I | +> 923 | 175,466,045 | T | +>| 76 | Arthur | 2003-12-06 19:14:01 | B | I | +> 1,872 | 516,372,637 | T | +>| 77 | Alexis | 2003-12-06 19:25:01 | B | I | +> 5,422 | 190,847,977 | T | +>| 78 | BackupCatalog | 2003-12-06 22:00:04 | B | F | +> 1 | 408,121,544 | T | +>| 79 | Zaphod | 2003-12-07 19:00:04 | B | I | +> 1,347 | 93,787,356 | T | +>| 80 | Arthur | 2003-12-07 19:12:06 | B | I | +> 705 | 496,647,729 | T | +>| 81 | Alexis | 2003-12-07 19:25:08 | B | I | +> 1,414 | 102,756,100 | T | +>| 82 | BackupCatalog | 2003-12-07 22:00:04 | B | F | +> 1 | 408,519,580 | T | +>| 83 | Zaphod | 2003-12-08 19:00:05 | B | I | +> 4,428 | 461,132,237 | T | +>| 84 | Arthur | 2003-12-08 19:15:59 | B | I | +> 307 | 384,713,540 | T | +>| 85 | Alexis | 2003-12-08 19:25:56 | B | I | +> 708 | 78,420,311 | T | +>| 86 | BackupCatalog | 2003-12-08 22:00:04 | B | F | +> 1 | 409,139,688 | T | +>| 87 | ReminderFullCartridge | 2003-12-09 06:00:05 | D | F | +> 0 | 0 | T | +>| 88 | Zaphod | 2003-12-09 19:00:05 | B | F | +>507,058 | 21,050,750,780 | T | +>| 89 | Arthur | 2003-12-09 21:27:07 | B | F | +>382,397 | 15,246,847,324 | T | +>| 90 | Alexis | 2003-12-09 23:18:30 | B | F | +>167,868 | 4,595,334,742 | T | +>| 91 | BackupCatalog | 2003-12-10 00:10:05 | B | F | +> 1 | 528,055,685 | T | +>+-------+-----------------------+---------------------+------+-------+----- +-----+----------------+-----------+ +>* +> +>Bacula did a FullBackup on December 2nd, which was the first Tuesday in +>this month. Correct. Then it did Incremenatial backups from 3rd until +>8th. Also correct. +>Yesterday, on December 9th - according to my schedule there should have +>been a differential backup!! But as you can see above, bacula did a Full +>backup - without reason, I think!! +>(This brings real big problems to my storage managment, because I don't +>have enough space for 4 Full-Backups a month. I urgently need diffential +>backups in the conecept) +>Could the cause be, that there's a pool change! Should the diffential +>backup better go to the inc-pool?? +> +>Please help!! +> +>Regards +>Volker +> +>P.S.: this is the job output of the jobs from Tue 9th, which should have +>been differential: +> +> +>z217-dir: Start Backup JobId 88, Job=Zaphod.2003-12-09_19.00.00 +>z217-sd: 3301 Issuing autochanger "loaded" command. +>z217-sd: Volume "F-6" previously written, moving to end of data. +>z217-sd: Ready to append to end of Volume at file=6. +>z217-sd: block.c:480 End of medium on device /dev/tape. Write of 64512 +>bytes got 32768. +>z217-sd: End of medium on Volume "F-6" Bytes=23,935,131,136 +>Blocks=371,020 at 09-Dec-2003 21:06. +>z217-sd: 3301 Issuing autochanger "loaded" command. +>z217-sd: 3302 Issuing autochanger "unload" command. +>z217-sd: 3303 Issuing autochanger "load slot 7" command. +>z217-sd: 3304 Autochanger "load slot 7" status is OK. +>z217-sd: Wrote label to prelabeled Volume "F-7" on device /dev/tape +>z217-sd: New volume "F-7" mounted on device /dev/tape at 09-Dec-2003 21:08. +>z217-dir: Bacula 1.32d (02Nov03): 09-Dec-2003 21:27 +>JobId: 88 +>Job: Zaphod.2003-12-09_19.00.00 +>Backup Level: Full +>Client: zaphod-fd +>FileSet: "Set Zaphod" 2003-11-21 16:32:26 +>Start time: 09-Dec-2003 19:00 +>End time: 09-Dec-2003 21:27 +>FD Files Written: 507,058 +>SD Files Written: 507,058 +>FD Bytes Written: 21,050,750,780 +>SD Bytes Written: 21,121,287,812 +>Rate: 2387.2 KB/s +>Software Compression: None +>Volume name(s): F-6|F-7 +>Volume Session Id: 14 +>Volume Session Time: 1070650983 +>Last Volume Bytes: 2,327,668,804 +>Non-fatal FD errors: 0 +>SD Errors: 0 +>FD termination status: OK +>SD termination status: OK +>Termination: Backup OK +> +>z217-dir: Begin pruning Jobs. +>z217-dir: No Jobs found to prune. +>z217-dir: Begin pruning Files. +>z217-dir: No Files found to prune. +>z217-dir: End auto prune. +> +> +> +>z217-dir: Start Backup JobId 89, Job=Arthur.2003-12-09_19.00.01 +>z217-dir: Bacula 1.32d (02Nov03): 09-Dec-2003 23:18 +>JobId: 89 +>Job: Arthur.2003-12-09_19.00.01 +>Backup Level: Full +>Client: z217-fd +>FileSet: "Set Arthur" 2003-11-21 18:47:14 +>Start time: 09-Dec-2003 21:27 +>End time: 09-Dec-2003 23:18 +>FD Files Written: 382,397 +>SD Files Written: 382,397 +>FD Bytes Written: 15,246,847,324 +>SD Bytes Written: 15,300,937,041 +>Rate: 2283.1 KB/s +>Software Compression: None +>Volume name(s): F-7 +>Volume Session Id: 15 +>Volume Session Time: 1070650983 +>Last Volume Bytes: 17,654,556,715 +>Non-fatal FD errors: 0 +>SD Errors: 0 +>FD termination status: OK +>SD termination status: OK +>Termination: Backup OK +> +>z217-dir: Begin pruning Jobs. +>z217-dir: No Jobs found to prune. +>z217-dir: Begin pruning Files. +>z217-dir: No Files found to prune. +>z217-dir: End auto prune. +> +> +> +>z217-dir: Start Backup JobId 90, Job=Alexis.2003-12-09_19.00.02 +>z217-dir: Bacula 1.32d (02Nov03): 10-Dec-2003 00:10 +>JobId: 90 +>Job: Alexis.2003-12-09_19.00.02 +>Backup Level: Full +>Client: alexis-fd +>FileSet: "Set Alexis" 2003-11-21 20:58:58 +>Start time: 09-Dec-2003 23:18 +>End time: 10-Dec-2003 00:10 +>FD Files Written: 167,868 +>SD Files Written: 167,868 +>FD Bytes Written: 4,595,334,742 +>SD Bytes Written: 4,616,435,343 +>Rate: 1487.2 KB/s +>Software Compression: None +>Volume name(s): F-7 +>Volume Session Id: 16 +>Volume Session Time: 1070650983 +>Last Volume Bytes: 22,280,313,500 +>Non-fatal FD errors: 0 +>SD Errors: 0 +>FD termination status: OK +>SD termination status: OK +>Termination: Backup OK +> +>z217-dir: Begin pruning Jobs. +>z217-dir: No Jobs found to prune. +>z217-dir: Begin pruning Files. +>z217-dir: No Files found to prune. +>z217-dir: End auto prune. +> +> +I'm trying to setup a surestore 12000e autochanger so far in my +bacula-sd.conf i have added this +Device { + Name = autochanger # + Media Type = DDS-2 + Archive Device = /dev/sa1 + AutomaticMount = yes; # when device opened, read it + AlwaysOpen = yes; + LabelMedia = yes; + RemovableMedia = yes; + Autochanger = yes; + Changer Device = /dev/pass0 #changer device +} +But i need to make an entry for the Changer Command = .I have +installed mtx but there are no sample files to be found or any +bacula samples for autochangers +Cheers Terry + + + + +------------------------------------------------------- +This SF.net email is sponsored by: SF.net Giveback Program. +Does SourceForge.net help you be more productive? Does it +help you create better code? SHARE THE LOVE, and help us help +YOU! Click Here: http://sourceforge.net/donate/ +_______________________________________________ +Bacula-users mailing list +Bacula-users@lists.sourceforge.net +https://lists.sourceforge.net/lists/listinfo/bacula-users + + +------------------------------------------------------- +This SF.net email is sponsored by: SF.net Giveback Program. +Does SourceForge.net help you be more productive? Does it +help you create better code? SHARE THE LOVE, and help us help +YOU! Click Here: http://sourceforge.net/donate/ +_______________________________________________ +Bacula-users mailing list +Bacula-users@lists.sourceforge.net +https://lists.sourceforge.net/lists/listinfo/bacula-users diff --git a/bacula/examples/autochangers/mtx-changer.Adic-Scalar-24 b/bacula/examples/autochangers/mtx-changer.Adic-Scalar-24 new file mode 100755 index 0000000000..16577cd605 --- /dev/null +++ b/bacula/examples/autochangers/mtx-changer.Adic-Scalar-24 @@ -0,0 +1,40 @@ +#!/bin/sh +# +# Bacula interface to mtx autoloader +# +# mtx-changer "changer-device" "command" "slot" +# +# Modified for Adic Scalar 24 with one LTO drive by +# M. Ludovic Strappozon +# +case "$2" in + unload) +# echo "Doing mtx -f $1 $2" + mtx -f $1 $2 + ;; + + load) +# echo "Doing mtx -f $1 $2 $3" + mtx -f $1 $2 $3 + sleep 20 + ;; + + list) +# echo "Requested list" +# mtx -f $1 status | grep " *Storage Element [0-9]*:.*Full" | awk "{print \$3}" | sed "s/:.*$/ /g" | tr -d "[\r\n]" + mtx -f $1 status | grep " *Storage Element [0-9]*:.*Full" | awk "{print \$3 \$4}" | sed "s/Full *\(:VolumeTag=\)*//" + ;; + + loaded) +# echo "Request loaded" + mtx -f $1 status >/tmp/mtx.$$ + cat /tmp/mtx.$$ | grep "^Data Transfer Element 0:Full" | awk "{print \$7}" + cat /tmp/mtx.$$ | grep "^Data Transfer Element 0:Empty" | awk "{print 0}" + rm -f /tmp/mtx.$$ + ;; + + slots) +# echo "Request slots" + mtx -f $1 status | grep " *Storage Changer" | awk "{print \$5}" + ;; +esac diff --git a/bacula/examples/autochangers/mtx-changer.StorageTek-HPA4853 b/bacula/examples/autochangers/mtx-changer.StorageTek-HPA4853 new file mode 100755 index 0000000000..d2eacf96a2 --- /dev/null +++ b/bacula/examples/autochangers/mtx-changer.StorageTek-HPA4853 @@ -0,0 +1,137 @@ +#!/bin/sh +# +# Bacula interface to mtx autoloader +# +# Created JAN/23/02 by Ludwig Jaffe +# +# Works with the HP A4853 DLT Library +# and the Storagetek Timberwolf 9730 DLT Library +# +#TAPEDRIVE0 holds the device/name of your 1st and only DLT drive (Bacula supports only 1 drive currently) +# +#Read TAPEDRIVE from command line parameters +if [ -z "$4" ] ; then + TAPEDRIVE0=/dev/st0 +else + TAPEDRIVE0=$4 +fi + +#Delay in seconds the tape needs to load the tape. Needed to stop bacula from using the tape too early. +TAPEDELAY=65 #The StorageTek Timberwolf 9730 with DLT7000 needs approx. 50 seconds to load. 65 sec gives safety +MTXCHVERBOSE=1 +if [ -z "$1" ] ; then + echo "" + echo "The mtx-changer script for bacula" + echo "---------------------------------" + echo "" + echo "usage: mtx-changer [slot] [devicename of tapedrive]" + echo " mtx-changer" + echo "" + echo "Valid commands:" + echo "" + echo "unload Unloads a tape into the slot" + echo " from where it was loaded." + echo "load Loads a tape from the slot " + echo "list Lists full storage slots" + echo "loaded Gives slot from where the tape was loaded." + echo " 0 means the tape drive is empty." + echo "slots Gives Number of aviable slots." + echo "" + echo "Example:" + echo " mtx-changer /dev/changer load 1 loads a tape from slot1" + echo "" + exit +fi + + +case "$2" in + unload) +# At first do mt -f /dev/st0 offline to unload the tape because HP A4853 aka Timberwolf9730 +# refuses to unload the tape from the drive if the DLT streamer did not unloaded it!!! +# + #Check if you want to fool me + if [ $MTXCHVERBOSE -eq 1 ] ; then echo "mtx-changer: Checking if drive is loaded before we unload. I Request loaded" ; fi + mtx -f $1 status >/tmp/mtx.$$ + rm -f /tmp/mtxloaded + cat /tmp/mtx.$$ | grep "^Data Transfer Element 0:Full" | awk "{print \$7}" > /tmp/mtxloaded + rm -f /tmp/mtx.$$ + read LOADEDVOL /tmp/mtx.$$ + rm -f /tmp/mtxloaded + cat /tmp/mtx.$$ | grep "^Data Transfer Element 0:Full" | awk "{print \$7}" > /tmp/mtxloaded + rm -f /tmp/mtx.$$ + read LOADEDVOL /tmp/mtx.$$ + cat /tmp/mtx.$$ | grep "^Data Transfer Element 0:Full" | awk "{print \$7}" + cat /tmp/mtx.$$ | grep "^Data Transfer Element 0:Empty" | awk "{print 0}" + rm -f /tmp/mtx.$$ + ;; + + slots) + if [ $MTXCHVERBOSE -eq 1 ] ; then echo "mtx-changer: Request slots" ; fi + mtx -f $1 status | grep "[ ]Storage Changer" | awk "{print \$5}" + ;; +esac diff --git a/bacula/examples/backup-acls.txt b/bacula/examples/backup-acls.txt new file mode 100644 index 0000000000..8aa1f4ff5b --- /dev/null +++ b/bacula/examples/backup-acls.txt @@ -0,0 +1,22 @@ +From: Volker Sauer +To: =?ISO-8859-1?Q?Daniel_Ch=E9nard?= +CC: Bacula users +Subject: Re: [Bacula-users] Bacula and the ACL +Date: Tue, 20 Jan 2004 23:32:52 +0100 + +You could use a script like that to dump the acls to a file which you +could restore with "setfacl --restore=" in case of a restore. + + +#!/bin/bash + +BACKUP_DIRS="/foo /bar" + +STORE_ACL=/root/acl-backup +umask 077 + +for i in $BACKUP_DIRS; do + cd $i + /usr/bin/getfacl -R --skip-base . >$STORE_ACL/${i//\//_} +done + diff --git a/bacula/examples/conf/bacula-dir.conf b/bacula/examples/conf/bacula-dir.conf new file mode 100644 index 0000000000..c3188e6a24 --- /dev/null +++ b/bacula/examples/conf/bacula-dir.conf @@ -0,0 +1,449 @@ +# +# Kerns Production Bacula Director Daemon Configuration file +# + +Director { + Name = HeadMan + DIRport = 9101 # where we listen for UA connections + QueryFile = "/home/bacula/bin/query.sql" + WorkingDirectory = "/home/bacula/bin/working" + PidDirectory = "/home/bacula/bin/working" + SubSysDirectory = "/home/bacula/bin/working" + Maximum Concurrent Jobs = 1 + Password = +} + +Schedule { + Name = "PolyMatouWeeklyCycle" + Run = Level=Full sun at 1:05 + Run = Level=Incremental mon-sat at 1:05 +} + +Schedule { + Name = "MatouWeeklyCycle" + Run = Level=Full 1st sat at 1:05 + Run = Level=Differential 2nd-5th sat at 1:05 + Run = Level=Incremental sun-fri at 1:05 +} + +Schedule { + Name = "VerifyCycle" + Run = Level=Catalog sun-sat at 5:05 +} + + +Schedule { + Name = "MinimatouWeeklyCycle" + Run = Level=Full fri at 1:05 + Run = Level=Incremental sat-thu at 1:05 +} + +Schedule { + Name = "MinouWeeklyCycle" + Run = Level=Full thu at 1:05 + Run = Level=Incremental fri-wed at 1:05 +} + +Schedule { + Name = "RufusWeeklyCycle" + Run = Level=Full 1st mon at 1:05 + Run = Level=Differential 2nd-5th mon at 1:05 + Run = Level=Incremental tue-sun at 1:05 +} + +Schedule { + Name = "CatalogSched" + Run = Level=Full sun-sat at 1:10 +} + +Schedule { + Name = "Watchdog" + Run = Level=Full sun-sat at 6:05 +} + + +Job { + Name = "Matou" + Type = Backup + Level = Incremental + Client=Matou + FileSet="Matou Set" + Messages = Standard + Storage = DLTDrive + Pool = Default + Schedule = "MatouWeeklyCycle" + Write Bootstrap = "/mnt/deuter/files/backup/matou.bsr" + Priority = 10 +} + +Job { + Name = "Polymatou" + Type = Backup + Level = Incremental + Client=Polymatou + FileSet="Full Set" + Messages = Standard + Storage = DLTDrive + Pool = Default + Schedule = "PolyMatouWeeklyCycle" + Write Bootstrap = "/mnt/deuter/files/backup/pmatou.bsr" + Priority = 10 +} + +Job { + Name = "Rufus" + Type = Backup + Level = Incremental + Client=Rufus + FileSet="RufusAll" + Messages = Standard + Storage = DLTDrive + Pool = Default + Schedule = "RufusWeeklyCycle" + Write Bootstrap = "/mnt/deuter/files/backup/rufus.bsr" + Priority = 10 +} + +Job { + Name = "Minimatou" + Type = Backup + Level = Incremental + Client=Minimatou + FileSet="Win32 Full Set" + Messages = Standard + Storage = DLTDrive + Pool = Default + Schedule = "MinimatouWeeklyCycle" + Write Bootstrap = "/mnt/deuter/files/backup/mmatou.bsr" + Priority = 11 +} + +Job { + Name = "Minou" + Type = Backup + Level = Incremental + Client=Minou + FileSet="Minou Full Set" + Messages = Standard + Storage = DLTDrive + Pool = Default + Schedule = "MinouWeeklyCycle" + Write Bootstrap = "/mnt/deuter/files/backup/minou.bsr" + Priority = 11 +} + +Job { + Name = "PmatouVerify" + Type = Verify + Level = Catalog + Client=PmatouVerify + FileSet="Verify Set" + Messages = Standard + Storage = DLTDrive + Pool = Default + Schedule = "VerifyCycle" + Priority = 20 # run after backups +} + +Job { + Name = "MatouVerify" + Type = Verify + Level = Catalog + Client=MatouVerify + FileSet="Verify Set" + Messages = Standard + Storage = DLTDrive + Pool = Default + Schedule = "VerifyCycle" + Priority = 20 +} + +Job { + Name = "RufusVerify" + Type = Verify + Level = Catalog + Client=RufusVerify + FileSet="Verify Set" + Messages = Standard + Storage = DLTDrive + Pool = Default + Schedule = "VerifyCycle" + Priority = 20 +} + +Job { + Name = "CatalogBackup" + Type = Backup + Level = Full + Client = Polymatou + FileSet = "CatalogFile" + Messages = Standard + Storage = DLTDrive + Pool = Default + Schedule = "CatalogSched" + RunBeforeJob = "/home/bacula/bin/make_catalog_backup" + RunAfterJob = "/home/bacula/bin/delete_catalog_backup" + Write Bootstrap = "/mnt/deuter/files/backup/catalog.bsr" + Priority = 15 # run after backups, but before Verifies +} + +Job { + Name = "Watchdog" + Type = Admin + Client=Watchdog + FileSet="Verify Set" + Messages = Standard + Storage = DLTDrive + Pool = Default + Schedule = "Watchdog" + RunAfterJob = "/home/bacula/bin/watchdog" + Priority = 99 # last job to run +} + +# Standard Restore template, to be changed by Console program +Job { + Name = "RestoreFiles" + Type = Restore + Client=Rufus + FileSet="Full Set" + Storage = DLTDrive + Messages = Standard + Pool = Default + Where = /tmp/bacula-restores +} + + +FileSet { + Name = "Matou Set" + Include = signature=MD5 { + / + /home + /usr + /files + } + Exclude = { /tmp/* } +} + + +FileSet { + Name = "Full Set" + Include = signature=MD5 { + @/etc/backup.list + } + Exclude = { } +} + +FileSet { + Name = "RufusAll" + Include = signature=MD5 { + / + /boot + /home + /usr + } + Exclude = { } +} + +# Backup the copy of the catalog +FileSet { + Name = "CatalogFile" + Include = signature=MD5 { + /home/bacula/bin/working/bacula.sql + } +} + + +FileSet { + Name = "Verify Set" + Include = verify=pins5 signature=MD5 { + /boot + /bin + /sbin + /usr/bin + /lib + /root/.ssh + /home/kern/.ssh + /var/named + /etc/sysconfig + /etc/ssh + /etc/security + /etc/exports + /etc/rc.d/init.d + /etc/sendmail.cf + /etc/sysctl.conf + /etc/services + /etc/xinetd.d + /etc/hosts.allow + /etc/hosts.deny + /etc/hosts + /etc/modules.conf + /etc/named.conf + /etc/pam.d + /etc/resolv.conf + } + Exclude = { } +} + + +FileSet { + Name = "Win32 Full Set" + Include = signature=MD5 { + "c:/My Documents" + } + Exclude = { } +} + +FileSet { + Name = "Minou Full Set" + Include = signature=MD5 { + "d:/My Documents" + } + Exclude = { } +} + +# Definition of tape storage device +Storage { + Name = DLTDrive + Address = lpmatou + SDPort = 9103 + Password = + Device = "HP DLT 80" # must be same as Device in Storage daemon + Media Type = DLT8000 # must be same as MediaType in Storage daemon +} + +#Storage { +# Name = "8mmDrive" +# Address = lpmatou +# SDPort = 9103 +# Password = +# Device = "Exabyte 8mm" +# MediaType = "8mm" +#} + +Client { + Name = Matou + Address = lmatou + FDPort = 9102 + Catalog = BackupDB + Password = + File Retention = 30d # 80 days + Job Retention = 1y # one year + AutoPrune = yes # Prune expired Jobs/Files +} + +Client { + Name = Polymatou + Address = lpmatou + FDPort = 9102 + Catalog = BackupDB + Password = + File Retention = 30d # 80 days + Job Retention = 1y # one year + AutoPrune = yes # Prune expired Jobs/Files +} + +Client { + Name = Rufus + Address = rufus + FDPort = 9102 + Catalog = BackupDB + Password = + File Retention = 30d # 80 days + Job Retention = 1y # one year + AutoPrune = yes # Prune expired Jobs/Files +} + +Client { + Name = Minimatou + Address = minimatou + FDPort = 9102 + Catalog = BackupDB + Password = + File Retention = 30d # 80 days + Job Retention = 1y # one year + AutoPrune = yes # Prune expired Jobs/Files +} + +Client { + Name = Minou + Address = minou + FDPort = 9102 + Catalog = BackupDB + Password = + File Retention = 30d # 80 days + Job Retention = 1y # one year + AutoPrune = yes # Prune expired Jobs/Files +} + +Client { + Name = MatouVerify + Address = lmatou + FDPort = 9102 + Catalog = Verify + Password = + File Retention = 30d # 30 days + Job Retention = 30d # 30 days + AutoPrune = yes # Prune expired Jobs/Files +} + +Client { + Name = PmatouVerify + Address = lpmatou + FDPort = 9102 + Catalog = Verify + Password = + File Retention = 30d # 30 days + Job Retention = 30d # 30 days + AutoPrune = yes # Prune expired Jobs/Files +} + +Client { + Name = RufusVerify + Address = rufus + FDPort = 9102 + Catalog = Verify + Password = + File Retention = 30d # 30 days + Job Retention = 30d # 30 days + AutoPrune = yes # Prune expired Jobs/Files +} + +Client { + Name = Watchdog + Address = rufus + FDPort = 9102 + Catalog = Verify + Password = + File Retention = 1d # 1 days + Job Retention = 1m # 1 month + AutoPrune = yes # Prune expired Jobs/Files +} + +Catalog { + Name = BackupDB + dbname = bacula; user = bacula; password = "" +} + +Catalog { + Name = Verify + dbname = verify; user = bacula; password = "" +} + +Messages { + Name = Standard + mailcommand = "/home/bacula/bin/smtp -h mail.sibbald.com -f \"\(Bacula\) %r\" -s \"Bacula: %t %e of %c %l\" %r" + operatorcommand = "/home/bacula/bin/smtp -h YOUR-SMTP_SERVER.com -f \"\(Bacula\) %r\" -s \"Bacula: Intervention needed for %j\" %r" + MailOnError = YOUR-EMAIL@YOU.com = all + append = "/home/bacula/bin/log" = all + operator = YOUR-EMAIL@YOU.com = mount + console = all +} + + +Pool { + Name = Default + Pool Type = Backup + Recycle = yes # Bacula can automatically recycle Volumes + AutoPrune = yes # Prune expired volumes + Volume Retention = 1y # one year +} diff --git a/bacula/examples/conf/bacula-fd.conf b/bacula/examples/conf/bacula-fd.conf new file mode 100644 index 0000000000..2e5fd48354 --- /dev/null +++ b/bacula/examples/conf/bacula-fd.conf @@ -0,0 +1,31 @@ +# +# Kern's Production Bacula File Daemon Configuration file +# +# +# "Global" File daemon configuration specifications +# +Client { # this is me + Name = "PolymatouFD" + FDport = 9102 # where we listen for the director + WorkingDirectory = "/home/bacula/bin/working" + PidDirectory = "/home/bacula/bin/working" + SubSysDirectory = "/home/bacula/bin/working" +} + +# +# List Directors who are permitted to contact the File daemon +# +Director { + Name = HeadMan + Password = "" +} + +Director { + Name = RightHandMan + Password = xxxxx +} + +Messages { + Name = Standard + director = HeadMan = all, !skipped +} diff --git a/bacula/examples/conf/bacula-sd.conf b/bacula/examples/conf/bacula-sd.conf new file mode 100644 index 0000000000..35521378b4 --- /dev/null +++ b/bacula/examples/conf/bacula-sd.conf @@ -0,0 +1,53 @@ +# +# Kern's Production Bacula Storage Daemon Configuration file +# + +# +# "Global" Storage daemon configuration specifications +# +Storage { + Name = "MainSD" + SDPort = 9103 # Directors port + WorkingDirectory = "/home/bacula/bin/working" + PidDirectory = "/home/bacula/bin/working" + SubSysDirectory = "/home/bacula/bin/working" +} + +# +# List Directors who are permitted to contact Storage daemon +# +Director { + Name = HeadMan + Password = "" +} + +# +# Devices supported by this Storage daemon +# To connect, the Director must have the same Name and MediaType, +# which are sent to the File daemon +# +Device { + Name = "HP DLT 80" + Media Type = DLT8000 + Archive Device = /dev/nst0 + AutomaticMount = yes; # when device opened, read it + AlwaysOpen = yes; + RemovableMedia = yes; +} + +#Device { +# Name = "Exabyte 8mm" +# Media Type = "8mm" +# Archive Device = /dev/nst1 +# Hardware end of medium = No; +## LabelMedia = yes; # lets Bacula label unlabelled media +# AutomaticMount = yes; # when device opened, read it +# AlwaysOpen = Yes; +# RemovableMedia = yes; +#} + +Messages { + Name = Standard + director = HeadMan = all + operator = root = mount +} diff --git a/bacula/examples/conf/console.conf b/bacula/examples/conf/console.conf new file mode 100644 index 0000000000..f5e70f153e --- /dev/null +++ b/bacula/examples/conf/console.conf @@ -0,0 +1,10 @@ +# +# Kern's Production Bacula User Agent Configuration File +# + +Director { + Name = HeadMan + DIRport = 9101 + address = "localhost" + Password = "" # Console password +} diff --git a/bacula/examples/conf/defaultconfig b/bacula/examples/conf/defaultconfig new file mode 100755 index 0000000000..d3e90537be --- /dev/null +++ b/bacula/examples/conf/defaultconfig @@ -0,0 +1,24 @@ +#!/bin/sh +# +# This is a default configuration file for Bacula that +# sets reasonable defaults, and assumes that you do not +# have MySQL running. It will "install" Bacula into +# bin and etc in the current directory. +# + +CFLAGS="-g -Wall" \ + ./configure \ + --sbindir=$HOME/bacula/bin \ + --sysconfdir=$HOME/bacula/bin \ + --with-pid-dir=$HOME/bacula/bin/working \ + --with-subsys-dir=$HOME/bacula/bin/working \ + --enable-smartalloc \ + --enable-gnome \ + --enable-static-tools \ + --with-mysql=$HOME/mysql \ + --with-working-dir=$HOME/bacula/bin/working \ + --with-dump-email=root@localhost \ + --with-job-email=root@localhost \ + --with-smtp-host=localhost + +exit 0 diff --git a/bacula/examples/conf/gnome-console.conf b/bacula/examples/conf/gnome-console.conf new file mode 100644 index 0000000000..f5e70f153e --- /dev/null +++ b/bacula/examples/conf/gnome-console.conf @@ -0,0 +1,10 @@ +# +# Kern's Production Bacula User Agent Configuration File +# + +Director { + Name = HeadMan + DIRport = 9101 + address = "localhost" + Password = "" # Console password +} diff --git a/bacula/examples/conf/kernsconfig b/bacula/examples/conf/kernsconfig new file mode 100755 index 0000000000..c8edf8918e --- /dev/null +++ b/bacula/examples/conf/kernsconfig @@ -0,0 +1,17 @@ +#!/bin/sh +# +# This is Kern's configure script for a test Bacula +# +CFLAGS="-g -O2 -Wall" ./configure \ + --sbindir=$HOME/bacula/bin \ + --sysconfdir=$HOME/bacula/bin \ + --with-pid-dir=$HOME/bacula/bin/working \ + --with-subsys-dir=$HOME/bacula/bin/working \ + --enable-gnome \ + --enable-smartalloc \ + --with-mysql=$HOME/mysql \ + --with-working-dir=$HOME/bacula/working \ + --with-dump-email=$USER \ + --with-job-email=$USER + +exit 0 diff --git a/bacula/examples/conf/many-clients.txt b/bacula/examples/conf/many-clients.txt new file mode 100644 index 0000000000..d8dba6638c --- /dev/null +++ b/bacula/examples/conf/many-clients.txt @@ -0,0 +1,106 @@ +From: Dan Langille +To: bacula-devel@lists.sourceforge.net +Subject: [Bacula-devel] script for creating many client FDs +Date Tue, 2 Dec 2003 19:41:28 -0500 (EST) + +I created this script which may be useful to others. If you have to +create a bacula-fd.conf file for more than a few clients, it can become +time consuming, not to mention error prone. + +Here is the usage: + +$ sh client-build.sh +client-build.sh : usage client-build.sh DIRNAME DIRPASSWD CLIENTNAME +[CLIENTNAME...] + +Where DIRNAME is the director name which can contact this client + PASSWD is the passwd to be supplied by the director + CLIENTNAME is the name of the client file daemon + +The script creates ./tmp and places all output there. + +bacula-fd.conf.in is the template it uses for creating the client scripts +and it must reside in the same directory as the script. + +Enjoy +-- +Dan Langille - http://www.langille.org/ + +==== bacula-fd.conf.in template ====== +# +# Default Bacula File Daemon Configuration file +# +# For Bacula release 1.32b (14 Oct 2003) -- freebsd 4.8-STABLE +# +# There is not much to change here except perhaps the +# File daemon Name to +# + +# +# List Directors who are permitted to contact this File daemon +# +Director { + Name = @dir-name@ + Password = "@dir-password@" +} + +# +# "Global" File daemon configuration specifications +# +FileDaemon { + Name = @client-name@ + FDport = 9102 # where we listen for the director + WorkingDirectory = /var/db/bacula + Pid Directory = /var/run +} + +# Send all messages except skipped files back to Director +Messages { + Name = Standard + director = undef-dir = all, !skipped +} +=== end bacula-fd.conf.in template ======== + + +==== client-build.sh =========== +#!/bin/sh +# +# Copyright 2003 Dan Langille +# +# Use as you wish, but keep retain this copyright notice. +# Please forward improvements. +# +# usage client-build.sh DIRNAME DIRPASSWD CLIENTNAME [CLIENTNAME...] +# +# Where DIRNAME is the director name which can contact this client +# PASSWD is the passwd to be supplied by the director +# CLIENTNAME is the name of the client file daemon +# +# This script creates ./tmp and places all output there. +# +# bacula-fd.conf.in is the template it uses for creating the client scripts. +# + + +if [ $# -lt 3 ] +then + echo $0 : usage $0 DIRNAME DIRPASSWD CLIENTNAME [CLIENTNAME...] + exit 1 +fi + +mkdir -p ./tmp + +DIRNAME=$1 +DIRPASSWD=$2 + +shift 2 + +echo creating stuff for $DIRNAME with password $DIRPASSWD + +while [ $# -gt 0 ] ; do + CLIENT=$1 + shift + echo "creating config for " $CLIENT + sed "s/@dir-name@/undef-dir/;s/@dir-password@/password/;s/@client-name@/$CLIENT/" bacula-fd.conf.in > ./tmp/$CLIENT-bacula-fd.conf +done +=== end client-build.sh =============== diff --git a/bacula/examples/dbdump/postgresql-dump.txt b/bacula/examples/dbdump/postgresql-dump.txt new file mode 100644 index 0000000000..7c82c3f17e --- /dev/null +++ b/bacula/examples/dbdump/postgresql-dump.txt @@ -0,0 +1,42 @@ +To: bacula-users@lists.sourceforge.net +Subject: Re: [Bacula-users] backup postgresql databases +From: Valtteri Vuorikoski +Date: 11 Mar 2004 14:56:13 +0000 + +Mathieu Arnold writes: + +> I was wondering if someone already had some script, or ways of doings scripts +> to backup (and maybe restore) pgsql databases. I'm balancing between taking a +> snapshot of the database directory and backuping that, dumping the datas into +> .sql.gz files, into .tgz files, or into a pipe letting bacula deal with the +> compression. + +Here's a quick shell script hack to dump all databases into separate tars +with pg_dump: + +do_pgsql() { + mkdir $dump_pg || exit 3 + psql -Atc 'select datname from pg_database where datistemplate=false' template1 postgres > $dump_pg/databases || exit 4 + + touch $dump_pg/dump.log + for d in `cat $dump_pg/databases` ; do + pg_dump -U postgres -Ft "$d" > $dump_pg/"$d.tar" >> $dump_pg/dump.log 2>&1 + [ "$retval" -eq 0 ] && retval=$? + done +} + +Set the variable dump_pg to point to the directly where you want the dump. Then +back it up and delete when you're done. + +You could probably use fs snapshots if you LOCK EXCLUSIVE all tables and CHECKPOINT +the transaction log, but as postgresql's relationship between files and tables is +not very transparent (such as with mysql), I think particularly partial restores +would end up being rather problematic. + +Backup/restore capability does not really appear to be postgresql's +forte, unfortunately. + +-- + Valtteri Vuorikoski + MagentaSites Oy + diff --git a/bacula/examples/dbdump/postgresql-mysql-dump.txt b/bacula/examples/dbdump/postgresql-mysql-dump.txt new file mode 100644 index 0000000000..68963f7aac --- /dev/null +++ b/bacula/examples/dbdump/postgresql-mysql-dump.txt @@ -0,0 +1,99 @@ +From: Mathieu Arnold +To: bacula-users@lists.sourceforge.net +Subject: Re: [Bacula-users] backup postgresql databases +Date: Fri, 12 Mar 2004 22:31:58 +0100 + ++-Le 11/03/2004 15:20 +0100, Mathieu Arnold a dit : +| Hi, +| +| I was wondering if someone already had some script, or ways of doings +| scripts to backup (and maybe restore) pgsql databases. I'm balancing +| between taking a snapshot of the database directory and backuping that, +| dumping the datas into .sql.gz files, into .tgz files, or into a pipe +| letting bacula deal with the compression. +| +| Any ideas ? :) + +Thanks to all ppl I got answers from (many used awfully hard way to get +databases), I cooked up my scripts (I needed mysql too), and here they are : + +-------------------------------------------- +#!/bin/sh + +export TMPDIR="/usr/tmp/" +export TEMP="/usr/tmp/" +export SAVE="/usr/tmp/dumps/" +export LANG="C" + +pg_user=pgsql +pg_dbuser=pgsql +pg_template=template1 +exclude=template +host=plouf + +sed=/usr/bin/sed +pg_dump=/usr/local/bin/pg_dump +pg_dumpall=/usr/local/bin/pg_dumpall +psql=/usr/local/bin/psql + +gzip="| /usr/bin/gzip -nc9" +gzext=".gz" + +if [ ! -d $SAVE ] +then + mkdir $SAVE +else + rm -f $SAVE/$host-pgsql* +fi + +su - $pg_user -c "$pg_dumpall -g $gzip" > $SAVE/$host-pgsql$gzext + +for i in $($psql -l $pg_template $pg_dbuser|sed -e '1,4d' -e +'/rows)$/,/\eof/d' -e '/template/d' -e 's/ \([^ ]*\).*$/\1/') +do + su - $pg_user -c "$pg_dump -c -F p $i $gzip" > $SAVE/$host-pgsql-$i$gzext +done +-------------------------------------------- + +For those using complicate selects to get databases list, I advise psql -l +:) + +and for mysql : + +-------------------------------------------- +#!/bin/sh + +export TMPDIR="/usr/tmp/" +export TEMP="/usr/tmp/" +export SAVE="/usr/tmp/dumps/" +export LANG="C" + +my_user=root +my_passwd=password +host=plouf + +sed=/usr/bin/sed +mysql=/usr/local/bin/mysql +mysqldump=/usr/local/bin/mysqldump + +gzip="/usr/bin/gzip -nc9" +gzext=".gz" + +if [ ! -d $SAVE ] +then + mkdir $SAVE +else + rm -f $SAVE/$host-mysql* +fi + +for i in $($mysql -u $my_user -p$my_passwd -e 'show databases'|$sed '1d') +do + $mysqldump -u $my_user -p$my_passwd $i | $gzip > $SAVE/$host-mysql-$i$gzext +done +-------------------------------------------- + +maybe those scripts will save some ppl some time :) + +-- +Mathieu Arnold + diff --git a/bacula/examples/nagios.txt b/bacula/examples/nagios.txt index f26fec33f2..03af14010d 100644 --- a/bacula/examples/nagios.txt +++ b/bacula/examples/nagios.txt @@ -1,56 +1,6 @@ -From bacula-users-admin@lists.sourceforge.net Wed Mar 3 22:08:24 2004 -Return-Path: -Received: from sc8-sf-list2.sourceforge.net (lists.sourceforge.net - [66.35.250.206]) by matou.sibbald.com (8.12.10/8.12.10) with ESMTP id - i23L8Nb7003158 for ; Wed, 3 Mar 2004 22:08:24 +0100 -Received: from localhost ([127.0.0.1] helo=projects.sourceforge.net) by - sc8-sf-list2.sourceforge.net with esmtp (Exim 4.30) id 1Ayddz-0005F7-EZ; - Wed, 03 Mar 2004 13:11:07 -0800 -Received: from sc8-sf-mx1-b.sourceforge.net ([10.3.1.11] - helo=sc8-sf-mx1.sourceforge.net) by sc8-sf-list2.sourceforge.net with esmtp - (Exim 4.30) id 1AyddU-00058Y-25 for bacula-users@lists.sourceforge.net; - Wed, 03 Mar 2004 13:10:36 -0800 -Received: from zola.netways.de ([213.95.25.82] - helo=net-sql2.int.netways.de) by sc8-sf-mx1.sourceforge.net with esmtp - (Exim 4.30) id 1AydXy-0008Im-KW for bacula-users@lists.sourceforge.net; - Wed, 03 Mar 2004 13:04:54 -0800 -Content-class: urn:content-classes:message -MIME-Version: 1.0 -Content-Type: text/plain; charset="iso-8859-1" Subject: RE: [Bacula-users] monitoring bacula with Nagios -X-MimeOLE: Produced By Microsoft Exchange V6.5.6944.0 -Message-ID: <2F6750F2110CAD41BE0BC33BB428B568FB9F@net-sql2.int.netways.de> -X-MS-Has-Attach: -X-MS-TNEF-Correlator: -Thread-Topic: [Bacula-users] monitoring bacula with Nagios -Thread-Index: AcPflloclgso3C9CREycI4VSOMnJBghyXnSwAACsf0A= From: "Julian Hein" To: -X-Spam-Score: 0.0 (/) -X-Spam-Report: Spam Filtering performed by sourceforge.net. See - http://spamassassin.org/tag/ for more details. Report problems to - http://sf.net/tracker/?func=add&group_id=1&atid=200001 -Sender: bacula-users-admin@lists.sourceforge.net -Errors-To: bacula-users-admin@lists.sourceforge.net -X-BeenThere: bacula-users@lists.sourceforge.net -X-Mailman-Version: 2.0.9-sf.net -Precedence: bulk -List-Unsubscribe: - , - -List-Id: Bacula user's email list for support and discussions - -List-Post: -List-Help: -List-Subscribe: - , - -List-Archive: - -Date: Wed, 3 Mar 2004 22:04:49 +0100 -X-MIME-Autoconverted: from quoted-printable to 8bit by matou.sibbald.com id - i23L8Nb7003158 -Content-Transfer-Encoding: 8bit Hi, @@ -127,20 +77,20 @@ use DBI; use Getopt::Long; use vars qw( $opt_help - $opt_job - $opt_critical - $opt_warning - $opt_hours - $opt_usage - $opt_version - $out - $sql - $date_start - $date_stop - $state - $count - ); - + $opt_job + $opt_critical + $opt_warning + $opt_hours + $opt_usage + $opt_version + $out + $sql + $date_start + $date_stop + $state + $count + ); + sub print_help(); sub print_usage(); sub get_now(); @@ -148,22 +98,22 @@ sub get_date; my $progname = basename($0); -my %ERRORS = ( 'UNKNOWN' => '-1', - 'OK' => '0', - 'WARNING' => '1', - 'CRITICAL' => '2'); +my %ERRORS = ( 'UNKNOWN' => '-1', + 'OK' => '0', + 'WARNING' => '1', + 'CRITICAL' => '2'); Getopt::Long::Configure('bundling'); GetOptions - ( - "c=s" => \$opt_critical, "critical=s" => \$opt_critical, - "w=s" => \$opt_warning, "warning=s" => \$opt_warning, - "H=s" => \$opt_hours, "hours=s" => \$opt_hours, - "j=s" => \$opt_job, "job=s" => \$opt_job, - "h" => \$opt_help, "help" => \$opt_help, - "usage" => \$opt_usage, - "V" => \$opt_version, "version" => \$opt_version - ) || die "Try '$progname --help' for more information.\n"; + ( + "c=s" => \$opt_critical, "critical=s" => \$opt_critical, + "w=s" => \$opt_warning, "warning=s" => \$opt_warning, + "H=s" => \$opt_hours, "hours=s" => \$opt_hours, + "j=s" => \$opt_job, "job=s" => \$opt_job, + "h" => \$opt_help, "help" => \$opt_help, + "usage" => \$opt_usage, + "V" => \$opt_version, "version" => \$opt_version + ) || die "Try '$progname --help' for more information.\n"; sub print_help() { print "\n"; @@ -253,15 +203,3 @@ Fon.0911/92885-0 D-90429 N Fax.0911/92885-31 jhein@netways.de www.netways.de - - - -------------------------------------------------------- -This SF.Net email is sponsored by: IBM Linux Tutorials -Free Linux tutorial presented by Daniel Robbins, President and CEO of -GenToo technologies. Learn everything from fundamentals to system -administration.http://ads.osdn.com/?ad_id70&alloc_id638&opÃŒk -_______________________________________________ -Bacula-users mailing list -Bacula-users@lists.sourceforge.net -https://lists.sourceforge.net/lists/listinfo/bacula-users diff --git a/bacula/kernstodo b/bacula/kernstodo index 24249fc5e6..175ff2db24 100644 --- a/bacula/kernstodo +++ b/bacula/kernstodo @@ -72,15 +72,15 @@ For 1.33 Testing/Documentation: Overland Neo2000 (LVD) For 1.33 +- On unknown client in restore "client=xxx" + Could not find Client "Matou": ERR=Query failed: DROP TABLE temp1: + ERR=no such table: temp1 From Chris Hull: it seems to be complaining about 12:00pm which should be a valid 12 hour time. I changed the time to 11:59am and everything works fine. Also 12:00am works fine. 0:00pm also works (which I don't think should). None of the values 12:00pm - 12:59pm work for that matter. - Use SHA1 on authentication if possible. -- Check: Run = Level=Differential feb-dec 1 at 1:05 to see if wday is empty. -- Look at installation file permissions with Scott so that make install - and the rpms agree. - Restore attributes of directory if replace=never set but directory did not exist. - Allow "delete job jobid=xx jobid=xxx". @@ -90,10 +90,7 @@ From Chris Hull: then list last 20 backups. - Allow browsing the catalog to see all versions of a file (with stat data on each file). -- Finish code passing files=nnn to restore start. - Add level to estimate command. -- Symbolic link a directory to another one, then backup the symbolic link. -- Check and possibly fix problems with hard links. - Fix "llist jobid=xx" where no fileset or client exists. - Add all pools in Dir conf to DB also update them to catch changed LabelFormats and such. @@ -103,16 +100,13 @@ From Chris Hull: it cannot be called recursively and set dequeuing flag. - Add a .list all files in the restore tree (probably also a list all files) Do both a long and short form. -- Finish work on conio.c -- See comtest-xxx.zip for Windows code to talk to USB. +- Finish work on conio.c -- particularly linking. - Phil says that Windows file sizes mismatch in Verify when they should, and that either the file size or the catalog size was zero. - Check time/dates printed during restore when using Win32 API. -- Add ctl-c to console to stop current command and discard buffered - output. -- Estimate to Tibs never returns. - Later: +- See comtest-xxx.zip for Windows code to talk to USB. - Make btape accept Device Names in addition to Archive names. - Add Events and Perl scripting. - Add John's appended files: @@ -1408,3 +1402,12 @@ Block Position: 0 - Rescue builds incorrect script files on Rufus. - Release SQLite 2.8.9 - During install, copy any console.conf to bconsole.conf. +- Check: Run = Level=Differential feb-dec 1 at 1:05 to see if wday is empty. +- Look at installation file permissions with Scott so that make install + and the rpms agree. +- Finish code passing files=nnn to restore start. +- Add ctl-c to console to stop current command and discard buffered + output. +- Estimate to Tibs never returns. +- Symbolic link a directory to another one, then backup the symbolic link. +- Check and possibly fix problems with hard links. diff --git a/bacula/src/cats/sql.c b/bacula/src/cats/sql.c index a3a291c31f..50b96467c7 100644 --- a/bacula/src/cats/sql.c +++ b/bacula/src/cats/sql.c @@ -297,56 +297,21 @@ void db_end_transaction(JCR *jcr, B_DB *mdb) * and filename parts. They are returned in pool memory * in the mdb structure. */ -void split_path_and_filename(JCR *jcr, B_DB *mdb, char *fname) +void split_path_and_file(JCR *jcr, B_DB *mdb, const char *fname) { - char *p, *f; - - /* Find path without the filename. - * I.e. everything after the last / is a "filename". - * OK, maybe it is a directory name, but we treat it like - * a filename. If we don't find a / then the whole name - * must be a path name (e.g. c:). - */ - for (p=f=fname; *p; p++) { - if (*p == '/') { - f = p; /* set pos of last slash */ - } - } - if (*f == '/') { /* did we find a slash? */ - f++; /* yes, point to filename */ - } else { /* no, whole thing must be path name */ - f = p; - } - - /* If filename doesn't exist (i.e. root directory), we - * simply create a blank name consisting of a single - * space. This makes handling zero length filenames - * easier. - */ - mdb->fnl = p - f; - if (mdb->fnl > 0) { - mdb->fname = check_pool_memory_size(mdb->fname, mdb->fnl+1); - memcpy(mdb->fname, f, mdb->fnl); /* copy filename */ - mdb->fname[mdb->fnl] = 0; - } else { + split_path_and_filename(fname, &mdb->path, &mdb->pnl, &mdb->fname, &mdb->fnl); + if (mdb->fnl == 0) { mdb->fname[0] = ' '; /* blank filename */ mdb->fname[1] = 0; mdb->fnl = 1; } - - mdb->pnl = f - fname; - if (mdb->pnl > 0) { - mdb->path = check_pool_memory_size(mdb->path, mdb->pnl+1); - memcpy(mdb->path, fname, mdb->pnl); - mdb->path[mdb->pnl] = 0; - } else { + if (mdb->pnl == 0) { Mmsg1(&mdb->errmsg, _("Path length is zero. File=%s\n"), fname); Jmsg(jcr, M_ERROR, 0, "%s", mdb->errmsg); mdb->path[0] = ' '; mdb->path[1] = 0; mdb->pnl = 1; } - Dmsg2(400, "split path=%s file=%s\n", mdb->path, mdb->fname); } diff --git a/bacula/src/cats/sql_create.c b/bacula/src/cats/sql_create.c index 4209ef52c9..a69471623d 100644 --- a/bacula/src/cats/sql_create.c +++ b/bacula/src/cats/sql_create.c @@ -55,7 +55,7 @@ extern void print_result(B_DB *mdb); extern int QueryDB(char *file, int line, JCR *jcr, B_DB *db, char *select_cmd); extern int InsertDB(char *file, int line, JCR *jcr, B_DB *db, char *select_cmd); extern int UpdateDB(char *file, int line, JCR *jcr, B_DB *db, char *update_cmd); -extern void split_path_and_filename(JCR *jcr, B_DB *mdb, char *fname); +extern void split_path_and_file(JCR *jcr, B_DB *mdb, const char *fname); /* Create a new record for the Job @@ -529,7 +529,7 @@ int db_create_file_attributes_record(JCR *jcr, B_DB *mdb, ATTR_DBR *ar) db_lock(mdb); - split_path_and_filename(jcr, mdb, ar->fname); + split_path_and_file(jcr, mdb, ar->fname); if (!db_create_filename_record(jcr, mdb, ar)) { db_unlock(mdb); diff --git a/bacula/src/cats/sql_get.c b/bacula/src/cats/sql_get.c index 700b6ba636..a1abcbd323 100644 --- a/bacula/src/cats/sql_get.c +++ b/bacula/src/cats/sql_get.c @@ -56,7 +56,7 @@ static int db_get_path_record(JCR *jcr, B_DB *mdb); /* Imported subroutines */ extern void print_result(B_DB *mdb); extern int QueryDB(char *file, int line, JCR *jcr, B_DB *db, char *select_cmd); -extern void split_path_and_filename(JCR *jcr, B_DB *mdb, char *fname); +extern void split_path_and_file(JCR *jcr, B_DB *mdb, const char *fname); @@ -73,7 +73,7 @@ int db_get_file_attributes_record(JCR *jcr, B_DB *mdb, char *fname, JOB_DBR *jr, Dmsg1(100, "db_get_file_att_record fname=%s \n", fname); db_lock(mdb); - split_path_and_filename(jcr, mdb, fname); + split_path_and_file(jcr, mdb, fname); fdbr->FilenameId = db_get_filename_record(jcr, mdb); diff --git a/bacula/src/console2.glade b/bacula/src/console2.glade index c62ae83ae8..5011ed46ef 100644 --- a/bacula/src/console2.glade +++ b/bacula/src/console2.glade @@ -4,15 +4,17 @@ - + True Bacula Console GTK_WINDOW_TOPLEVEL GTK_WIN_POS_CENTER False + 700 + 600 True False - + @@ -458,7 +460,7 @@ True - + False False GTK_JUSTIFY_LEFT @@ -546,6 +548,8 @@ 1 + 400 + 640 True True True @@ -586,7 +590,7 @@ True - Bacula Console 1.32c (24 Oct 03) + Bacula Console 1.34.0 (16 Mar 04) False False @@ -619,7 +623,7 @@ True - Copyright (c) 1999 - 2002, Kern Sibbald and John Walker + Copyright (c) 2000 - 2004, Kern Sibbald and John Walker False False GTK_JUSTIFY_LEFT @@ -2190,14 +2194,19 @@ - + + 640 + 480 True Restore File Selection GTK_WINDOW_TOPLEVEL GTK_WIN_POS_NONE True + 640 + 400 True False + @@ -2206,28 +2215,244 @@ 0 - + True - GTK_POLICY_ALWAYS - GTK_POLICY_ALWAYS - GTK_SHADOW_IN - GTK_CORNER_TOP_LEFT + GTK_SHADOW_OUT + GTK_POS_LEFT + GTK_POS_TOP - + True - True - True - False - False - True + + + + True + GNOMEUIINFO_MENU_FILE_TREE + + + + + + + True + GNOMEUIINFO_MENU_NEW_ITEM + _New + True + + + + + + + True + GNOMEUIINFO_MENU_OPEN_ITEM + + + + + + + True + GNOMEUIINFO_MENU_SAVE_ITEM + + + + + + + True + GNOMEUIINFO_MENU_SAVE_AS_ITEM + + + + + + + True + + + + + + True + GNOMEUIINFO_MENU_EXIT_ITEM + + + + + + + + + + + True + GNOMEUIINFO_MENU_EDIT_TREE + + + + + + + True + GNOMEUIINFO_MENU_CUT_ITEM + + + + + + + True + GNOMEUIINFO_MENU_COPY_ITEM + + + + + + + True + GNOMEUIINFO_MENU_PASTE_ITEM + + + + + + + True + GNOMEUIINFO_MENU_CLEAR_ITEM + + + + + + + True + + + + + + True + GNOMEUIINFO_MENU_PROPERTIES_ITEM + + + + + + + True + + + + + + True + GNOMEUIINFO_MENU_PREFERENCES_ITEM + + + + + + + + + + + True + GNOMEUIINFO_MENU_VIEW_TREE + + + + + + + + + + + True + GNOMEUIINFO_MENU_HELP_TREE + + + + + + + True + GNOMEUIINFO_MENU_ABOUT_ITEM + + + + + + + 0 - True - True + False + False + + + + + + True + GTK_SHADOW_OUT + GTK_POS_LEFT + GTK_POS_TOP + + + + True + GTK_ORIENTATION_HORIZONTAL + GTK_TOOLBAR_BOTH + True + + + + True + gtk-go-up + True + + + + + + + True + gtk-add + True + + + + + + + True + gtk-remove + True + + + + + + + + + + + + + + + + 0 + False + False @@ -2240,7 +2465,7 @@ True - cwd: + Current dir: False False GTK_JUSTIFY_CENTER @@ -2259,13 +2484,9 @@ - + True - Enter Commands Here - True - True True - True True True 0 @@ -2273,8 +2494,6 @@ True * False - - 0 @@ -2290,52 +2509,129 @@ + + + True + True + GTK_POLICY_ALWAYS + GTK_POLICY_ALWAYS + GTK_SHADOW_NONE + GTK_CORNER_TOP_LEFT + + + + + + + 0 + True + True + + + True - False + True 0 - + True - + False False - GTK_JUSTIFY_FILL + GTK_JUSTIFY_LEFT False False - 0.5 + 0.94 0.5 - 59 + 0 0 0 True - False + True - - 9 + True True gtk-ok True GTK_RELIEF_NORMAL - + 0 - True + False + True + + + + + + True + + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + True + True + gtk-cancel + True + GTK_RELIEF_NORMAL + + + + 0 + False + True + + + + + + True + + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + + + 0 + False False - 0 + 7 False True @@ -2344,9 +2640,9 @@ - + True - Restore Files + Label a Volume GTK_WINDOW_TOPLEVEL GTK_WIN_POS_NONE True @@ -2355,43 +2651,43 @@ True - + True False 0 - + True GTK_BUTTONBOX_END - + True GTK_BUTTONBOX_END 8 - + True True True gtk-ok True GTK_RELIEF_NORMAL - + - + True True True gtk-cancel True GTK_RELIEF_NORMAL - + @@ -2406,304 +2702,13 @@ - + True False 0 - - 8 - True - 0 - 0.5 - GTK_SHADOW_ETCHED_IN - - - - True - False - 0 - - - - True - - False - False - GTK_JUSTIFY_CENTER - False - False - 0.5 - 0.5 - 0 - 0 - - - 0 - False - False - GTK_PACK_END - - - - - - True - False - 0 - - - - True - - False - False - GTK_JUSTIFY_CENTER - False - False - 0.5 - 0.5 - 0 - 2 - - - 0 - False - False - - - - - - 3 - True - True - Select most recent backup - True - GTK_RELIEF_NORMAL - True - False - True - - - 0 - False - False - - - - - - 5 - True - True - Select list of Jobs - True - GTK_RELIEF_NORMAL - False - False - True - - - 0 - False - False - - - - - - 4 - True - True - Find a specific file - True - GTK_RELIEF_NORMAL - False - False - True - - - 0 - False - False - - - - - - True - - False - False - GTK_JUSTIFY_CENTER - False - False - 0.5 - 0.5 - 0 - 0 - - - 0 - False - False - - - - - 0 - True - True - - - - - - - - True - Select by: - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - - - label_item - - - - - 0 - True - True - - - - - - True - False - 0 - - - - - - - - 50 - True - True - gtk-apply - True - GTK_RELIEF_NORMAL - - - - 0 - False - False - - - - - - - - - 0 - False - False - - - - - 0 - True - True - - - - - - - - True - Label a Volume - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_NONE - True - True - False - True - - - - True - False - 0 - - - - True - GTK_BUTTONBOX_END - - - - True - GTK_BUTTONBOX_END - 8 - - - - True - True - True - gtk-ok - True - GTK_RELIEF_NORMAL - - - - - - - True - True - True - gtk-cancel - True - GTK_RELIEF_NORMAL - - - - - - - - 0 - False - True - GTK_PACK_END - - - - - - True - False - 0 - - - + True Label a Volume False @@ -3110,4 +3115,922 @@ + + True + Restore Files Dialog + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_NONE + False + 300 + 200 + True + False + True + + + + True + False + 0 + + + + True + GTK_BUTTONBOX_END + + + + True + True + True + gtk-help + True + GTK_RELIEF_NORMAL + -11 + + + + + + True + True + True + GTK_RELIEF_NORMAL + 0 + + + + + True + 0.5 + 0.5 + 0 + 0 + + + + True + False + 2 + + + + True + gtk-apply + 4 + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + True + Select Files + True + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + + + + + + + True + True + True + gtk-cancel + True + GTK_RELIEF_NORMAL + -6 + + + + + + 0 + False + True + GTK_PACK_END + + + + + + True + False + 0 + + + + True + False + 0 + + + + True + Restore Files + False + False + GTK_JUSTIFY_CENTER + False + False + 0.5 + 0.5 + 0 + 9 + + + 2 + False + False + + + + + + True + 0.5 + 0.5 + 1 + 1 + + + + True + False + 0 + + + + True + False + 0 + + + + 66 + 16 + True + Job: + False + False + GTK_JUSTIFY_RIGHT + False + False + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + True + True + False + False + True + False + + + + True + True + False + True + 0 + + True + * + False + + + + + + + True + GTK_SELECTION_BROWSE + + + + True + + + + True + + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + + + + + + + + + 1 + True + True + + + + + + True + + False + False + GTK_JUSTIFY_CENTER + False + False + 0.5 + 0.5 + 0 + 0 + + + 27 + False + False + + + + + 0 + True + True + + + + + + + 2 + False + False + + + + + + True + False + 0 + + + + 66 + 16 + True + Client: + False + False + GTK_JUSTIFY_RIGHT + False + False + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + True + True + False + False + True + False + + + + True + True + False + True + 0 + + True + * + False + + + + + + True + GTK_SELECTION_BROWSE + + + + True + + + + True + + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + + + + + + + + + 1 + True + True + + + + + + True + + False + False + GTK_JUSTIFY_CENTER + False + False + 0.5 + 0.5 + 0 + 0 + + + 25 + False + False + + + + + 0 + True + True + + + + + + True + False + 0 + + + + 66 + 16 + True + FileSet: + False + False + GTK_JUSTIFY_RIGHT + False + False + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + True + True + False + False + True + False + + + + True + True + False + True + 0 + + True + * + False + + + + + + True + GTK_SELECTION_BROWSE + + + + True + + + + True + + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + + + + + + + + + 0 + True + True + + + + + + True + + False + False + GTK_JUSTIFY_CENTER + False + False + 0.5 + 0.5 + 0 + 0 + + + 23 + False + False + + + + + 2 + True + True + + + + + + True + False + 0 + + + + 66 + 16 + True + Pool: + False + False + GTK_JUSTIFY_CENTER + False + False + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + True + True + False + False + True + False + + + + True + True + False + True + 0 + + True + * + False + + + + + + True + GTK_SELECTION_BROWSE + + + + True + + + + True + + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + + + + + + + + True + + + + True + + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + + + + + + + + + 0 + True + True + + + + + + True + + False + False + GTK_JUSTIFY_CENTER + False + False + 0.5 + 0.5 + 0 + 0 + + + 21 + False + False + + + + + 2 + True + True + + + + + + True + False + 0 + + + + 66 + 16 + True + Storage: + False + False + GTK_JUSTIFY_CENTER + False + False + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + True + True + False + False + True + False + + + + True + True + False + True + 0 + + True + * + False + + + + + + True + GTK_SELECTION_BROWSE + + + + True + + + + True + + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + + + + + + + + True + + + + True + + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + + + + + + + + + 0 + True + True + + + + + + True + + False + False + GTK_JUSTIFY_CENTER + False + False + 0.5 + 0.5 + 0 + 0 + + + 21 + False + False + + + + + 0 + True + True + + + + + 0 + True + True + + + + + + True + False + 0 + + + + 66 + 16 + True + Before: + False + False + GTK_JUSTIFY_CENTER + False + False + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + True + True + True + True + 0 + + True + * + False + + + 0 + True + True + + + + + + True + + False + False + GTK_JUSTIFY_CENTER + False + False + 0.5 + 0.5 + 0 + 0 + + + 53 + False + False + + + + + 0 + True + True + + + + + + True + + False + False + GTK_JUSTIFY_CENTER + False + False + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + 0 + True + True + + + + + + diff --git a/bacula/src/dird/ua_restore.c b/bacula/src/dird/ua_restore.c index 22357d7107..a79eb8b0fc 100644 --- a/bacula/src/dird/ua_restore.c +++ b/bacula/src/dird/ua_restore.c @@ -309,9 +309,10 @@ static int user_select_jobids_or_files(UAContext *ua, RESTORE_CTX *rx) "pool", /* 5 */ "client", /* 6 */ "storage", /* 7 */ - "where", /* 8 */ - "all", /* 9 */ - "yes", /* 10 */ + "fileset", /* 8 */ + "where", /* 9 */ + "all", /* 10 */ + "yes", /* 11 */ NULL }; diff --git a/bacula/src/lib/protos.h b/bacula/src/lib/protos.h index fa2d82b6a4..5d79868fc3 100644 --- a/bacula/src/lib/protos.h +++ b/bacula/src/lib/protos.h @@ -180,9 +180,11 @@ void strip_trailing_slashes (char *dir); bool skip_spaces (char **msg); bool skip_nonspaces (char **msg); int fstrsch (char *a, char *b); +char *next_arg(char **s); int parse_args(POOLMEM *cmd, POOLMEM **args, int *argc, char **argk, char **argv, int max_args); -char *next_arg(char **s); +void split_path_and_filename(const char *fname, POOLMEM **path, + int *pnl, POOLMEM **file, int *fnl); /* util.c */ int is_buf_zero (char *buf, int len); diff --git a/bacula/src/lib/scan.c b/bacula/src/lib/scan.c index 34c31d2d2b..ac1447a721 100644 --- a/bacula/src/lib/scan.c +++ b/bacula/src/lib/scan.c @@ -1,7 +1,7 @@ /* * scan.c -- scanning routines for Bacula * - * Kern Sibbald, MM separated from util.c MMIII + * Kern Sibbald, MM separated from util.c MMIII * * Version $Id$ */ @@ -55,9 +55,9 @@ void strip_trailing_slashes(char *dir) /* * Skip spaces - * Returns: 0 on failure (EOF) - * 1 on success - * new address in passed parameter + * Returns: 0 on failure (EOF) + * 1 on success + * new address in passed parameter */ bool skip_spaces(char **msg) { @@ -74,9 +74,9 @@ bool skip_spaces(char **msg) /* * Skip nonspaces - * Returns: 0 on failure (EOF) - * 1 on success - * new address in passed parameter + * Returns: 0 on failure (EOF) + * 1 on success + * new address in passed parameter */ bool skip_nonspaces(char **msg) { @@ -101,19 +101,19 @@ fstrsch(char *a, char *b) /* folded case search */ s1=a; s2=b; - while (*s1) { /* do it the fast way */ + while (*s1) { /* do it the fast way */ if ((*s1++ | 0x20) != (*s2++ | 0x20)) - return 0; /* failed */ + return 0; /* failed */ } - while (*a) { /* do it over the correct slow way */ + while (*a) { /* do it over the correct slow way */ if (B_ISUPPER(c1 = *a)) { - c1 = tolower((int)c1); + c1 = tolower((int)c1); } if (B_ISUPPER(c2 = *b)) { - c2 = tolower((int)c2); + c2 = tolower((int)c2); } if (c1 != c2) { - return 0; + return 0; } a++; b++; @@ -134,31 +134,31 @@ char *next_arg(char **s) /* skip past spaces to next arg */ for (p=*s; *p && B_ISSPACE(*p); ) { p++; - } + } Dmsg1(400, "Next arg=%s\n", p); for (n = q = p; *p ; ) { if (*p == '\\') { - p++; - if (*p) { - *q++ = *p++; - } else { - *q++ = *p; - } - continue; + p++; + if (*p) { + *q++ = *p++; + } else { + *q++ = *p; + } + continue; } if (*p == '"') { /* start or end of quote */ - if (in_quote) { - p++; /* skip quote */ - in_quote = false; - continue; - } - in_quote = true; - p++; - continue; + if (in_quote) { + p++; /* skip quote */ + in_quote = false; + continue; + } + in_quote = true; + p++; + continue; } if (!in_quote && B_ISSPACE(*p)) { /* end of field */ - p++; - break; + p++; + break; } *q++ = *p++; } @@ -189,7 +189,7 @@ char *next_arg(char **s) */ int parse_args(POOLMEM *cmd, POOLMEM **args, int *argc, - char **argk, char **argv, int max_args) + char **argk, char **argv, int max_args) { char *p, *q, *n; @@ -201,33 +201,33 @@ int parse_args(POOLMEM *cmd, POOLMEM **args, int *argc, while (*argc < max_args) { n = next_arg(&p); if (*n) { - argk[*argc] = n; - argv[(*argc)++] = NULL; + argk[*argc] = n; + argv[(*argc)++] = NULL; } else { - break; + break; } } /* Separate keyword and value */ for (int i=0; i < *argc; i++) { p = strchr(argk[i], '='); if (p) { - *p++ = 0; /* terminate keyword and point to value */ - /* Unquote quoted values */ + *p++ = 0; /* terminate keyword and point to value */ + /* Unquote quoted values */ if (*p == '"') { for (n = q = ++p; *p && *p != '"'; ) { if (*p == '\\') { - p++; - } - *q++ = *p++; - } - *q = 0; /* terminate string */ - p = n; /* point to string */ - } - if (strlen(p) > MAX_NAME_LENGTH-1) { - p[MAX_NAME_LENGTH-1] = 0; /* truncate to max len */ - } + p++; + } + *q++ = *p++; + } + *q = 0; /* terminate string */ + p = n; /* point to string */ + } + if (strlen(p) > MAX_NAME_LENGTH-1) { + p[MAX_NAME_LENGTH-1] = 0; /* truncate to max len */ + } } - argv[i] = p; /* save ptr to value or NULL */ + argv[i] = p; /* save ptr to value or NULL */ } #ifdef xxxx for (int i=0; i < *argc; i++) { @@ -236,3 +236,58 @@ int parse_args(POOLMEM *cmd, POOLMEM **args, int *argc, #endif return 1; } + +/* + * Given a full filename, split it into its path + * and filename parts. They are returned in pool memory + * in the arguments provided. + */ +void split_path_and_filename(const char *fname, POOLMEM **path, int *pnl, + POOLMEM **file, int *fnl) +{ + const char *p, *f; + int slen; + int len = slen = strlen(fname); + + /* + * Find path without the filename. + * I.e. everything after the last / is a "filename". + * OK, maybe it is a directory name, but we treat it like + * a filename. If we don't find a / then the whole name + * must be a path name (e.g. c:). + */ + p = fname; + f = fname + len - 1; + /* "strip" any trailing slashes */ + while (slen > 0 && *f == '/') { + slen--; + f--; + } + /* Walk back to last slash -- begin of filename */ + while (slen > 0 && *f != '/') { + slen--; + f--; + } + if (*f == '/') { /* did we find a slash? */ + f++; /* yes, point to filename */ + } else { /* no, whole thing must be path name */ + f = fname; + } + Dmsg2(200, "after strip len=%d f=%s\n", len, f); + *fnl = fname - f + len; + if (*fnl > 0) { + *file = check_pool_memory_size(*file, *fnl+1); + memcpy(*file, f, *fnl); /* copy filename */ + } + (*file)[*fnl] = 0; + + *pnl = f - fname; + if (*pnl > 0) { + *path = check_pool_memory_size(*path, *pnl+1); + memcpy(*path, fname, *pnl); + } + (*path)[*pnl] = 0; + + Dmsg2(200, "pnl=%d fnl=%d\n", *pnl, *fnl); + Dmsg3(200, "split fname=%s path=%s file=%s\n", fname, *path, *file); +} diff --git a/bacula/src/tools/bsmtp.c b/bacula/src/tools/bsmtp.c index 22d868247d..4df5776f8e 100644 --- a/bacula/src/tools/bsmtp.c +++ b/bacula/src/tools/bsmtp.c @@ -68,7 +68,7 @@ static void get_response(void) Pmsg2(0, "Fatal malformed reply from %s: %s\n", mailhost, buf); exit(1); } - if (buf[4] != '-') { + if (buf[3] != '-') { break; } } diff --git a/bacula/src/version.h b/bacula/src/version.h index 0bdfdbb83d..81a889092d 100644 --- a/bacula/src/version.h +++ b/bacula/src/version.h @@ -2,8 +2,8 @@ #undef VERSION #define VERSION "1.33.4" #define VSTRING "1" -#define BDATE "13 Mar 2004" -#define LSMDATE "13Mar04" +#define BDATE "18 Mar 2004" +#define LSMDATE "18Mar04" /* Debug flags */ #undef DEBUG -- 2.39.5