#! /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 for Debian (http://www.debian.org), # in the PUBLIC DOMAIN. PATH=/bin:/sbin:/usr/bin:/usr/sbin [ -x /usr/bin/storeBackup ] || exit 0 configs=$(find /etc/storebackup.d/ -type f \( ! -iname "*~" ! -iname "*.swp" ! -iname "*.udf" \)) delayed_error='' if [ -n "${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