This file is indexed.

/usr/share/gforge/cronjobs/gforge-db-backup.sh is in gforge-db-postgresql 5.1.1-2.

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
#!/bin/sh

# This script does personal backups to a rsync backup server. You will end up
# with a 7 day rotating incremental backup. The incrementals will go
# into subdirectories named after the day of the week, and the current
# full backup goes into a directory called "current"

if [ $(id -u) != 0 ] ; then
    echo "You must be root to run this, please enter passwd"
    exec su -c "$0 $1"
fi

# directory to backup
BDIR="/var/lib/gforge/chroot /var/lib/mailman /etc"
PATTERNS="mailman postgresql exim4 gforge"

DEST="/var/lib/gforge/backup"

# BACKUPDIR=`date --date yesterday +%A`
BACKUPDIR=`date +%A`
# BACKUPDIR=`date --date tomorrow +%A`
# BACKUPDIR=`date --date "2 days" +%A`
OPTS="--force --ignore-errors --delete --backup --backup-dir=$DEST/$BACKUPDIR -a"

[ ! -d ${DEST} ] && mkdir ${DEST}
[ ! -d ${DEST}/postgres ] && mkdir ${DEST}/postgres
[ ! -d ${DEST}/debconf ] && mkdir ${DEST}/debconf

echo "Backuping data from $BDIR"
# the following line clears the last weeks incremental directory
[ -d $DEST/emptydir ] || mkdir $DEST/emptydir
rsync --delete -a $DEST/emptydir/ $DEST/$BACKUPDIR/
rmdir $DEST/emptydir

# now the actual transfer
rsync $OPTS $BDIR $DEST/current

echo "Dumping database"
su -s /bin/bash postgres -c "pg_dump -F c -d gforge" | gzip -c > ${DEST}/postgres/gforge.dump.gz

echo "Dumping debconf keys"
for PAT in $PATTERNS
do
        debconf-copydb configdb stdout -c Name:stdout -c Driver:Pipe -c InFd:none \
                --pattern='^'${PAT}'/' > ${DEST}/debconf/${PAT}.txt
        chmod 0700 ${DEST}/debconf/${PAT}.txt
done