File: cron-storebackup

package info (click to toggle)
storebackup 3.2.1-2~deb10u1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 2,168 kB
  • sloc: perl: 18,684; makefile: 44; sh: 37
file content (35 lines) | stat: -rwxr-xr-x 743 bytes parent folder | download | duplicates (6)
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