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
|
#! /bin/sh -e
# run storeBackup on all files in /etc/storebackup.d/ sequentially
# file names must consist entirely of letters, digits, underscores, and hyphens
# Written by Arthur Korn <arthur@korn.ch> for Debian (http://www.debian.org),
# in the PUBLIC DOMAIN.
PATH=/bin:/sbin:/usr/bin:/usr/sbin
[ -x /usr/bin/storeBackup ] || exit 0
configs=`run-parts --list /etc/storebackup.d/`
delayed_error=''
if [ "$configs" ]; then
tmplog=`mktemp -t storebackup.XXXXXXXXXX`
for file in $configs
do
if ! nice storeBackup -f "$file" > "$tmplog" 2>&1
then
echo Error running backup for \"$file\" >&2
cat "$tmplog" >&2
delayed_error=1
fi
done
rm $tmplog || true
[ $delayed_error ] && exit 1;
fi
exit 0
|