/usr/sbin/amcheckdb is in amanda-server 1:3.3.3-2ubuntu1.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 | #! /bin/bash
#
# check tapelist against database and vice versa
#
prefix="/usr"
exec_prefix="${prefix}"
sbindir="/usr/sbin"
amlibexecdir="/usr/lib/amanda"
. "${amlibexecdir}/amanda-sh-lib.sh"
ConfigDir=/etc/amanda
# add sbin and ucb dirs
PATH="$PATH:/usr/sbin:/sbin:/usr/ucb"
export PATH
Program=`basename $0`
log () {
echo 1>&2 "$@"
return 0
}
Config=$1
if [ "$Config" = "" ]; then
log "usage: ${Program} <config>"
exit 1
fi
shift;
#
# Check if the configuration directory exists. Make sure that the
# necessary files can be found, such as amanda.conf and tapelist.
#
if [ ! -d ${ConfigDir}/${Config} ]; then
log "${Program}: configuration directory ${ConfigDir}/${Config} does not exist."
exit 1
fi
(cd ${ConfigDir}/${Config} >/dev/null 2>&1) || exit $?
cd ${ConfigDir}/${Config}
if [ ! -r amanda.conf ]; then
log "${Program}: amanda.conf not found or is not readable in ${ConfigDir}."
exit 1
fi
# Get the location and name of the tapelist filename. If tapelist is not
# specified in the amanda.conf file, then use tapelist in the config
# directory.
TapeList=`amgetconf${SUF} $Config tapelist "@$"`
if [ ! "$TapeList" ]; then
TapeList="$ConfigDir/$Config/tapelist"
fi
if [ ! -r $TapeList ]; then
log "${Program}: $TapeList not found or is not readable."
exit 1
fi
Amadmin=$sbindir/amadmin
[ ! -f $Amadmin ] \
&& echo `_ '%s was not found' $Amadmin` >&2 \
&& exit 1
[ ! -x $Amadmin ] \
&& echo `_ '%s is not executable' $Amadmin` >&2 \
&& exit 1
$Amadmin $Config export "$@"\
| grep "^stats: " \
| while read LINE; do
[ "$LINE" = "" ] && continue
set $LINE
echo $8
done \
| sort -u \
| while read TAPE; do
[ "$TAPE" = "" ] && continue
grep " $TAPE " $TapeList 2>/dev/null >/dev/null
[ $? != 0 ] \
&& echo `_ 'Tape %s missing in %s' "$TAPE" "$TapeList"`
done
echo `_ 'Ready.'`
exit 0
|