1 diff -Naur gforge-4.5.3n7/cronjobs/gforge-db-backup.sh gforge-4.5.3n7-backups/cronjobs/gforge-db-backup.sh
2 --- gforge-4.5.3n7/cronjobs/gforge-db-backup.sh 1970-01-01 01:00:00.000000000 +0100
3 +++ gforge-4.5.3n7-backups/cronjobs/gforge-db-backup.sh 2005-11-21 10:04:44.026175992 +0100
7 +# This script does personal backups to a rsync backup server. You will end up
8 +# with a 7 day rotating incremental backup. The incrementals will go
9 +# into subdirectories named after the day of the week, and the current
10 +# full backup goes into a directory called "current"
12 +if [ $(id -u) != 0 ] ; then
13 + echo "You must be root to run this, please enter passwd"
17 +# directory to backup
18 +BDIR="/var/lib/gforge/chroot /var/lib/mailman /etc"
19 +PATTERNS="mailman postgresql exim4 gforge"
23 +# BACKUPDIR=`date --date yesterday +%A`
25 +# BACKUPDIR=`date --date tomorrow +%A`
26 +# BACKUPDIR=`date --date "2 days" +%A`
27 +OPTS="--force --ignore-errors --delete --backup --backup-dir=$DEST/$BACKUPDIR -a"
29 +[ ! -d ${DEST} ] && mkdir ${DEST}
30 +[ ! -d ${DEST}/postgres ] && mkdir ${DEST}/postgres
31 +[ ! -d ${DEST}/debconf ] && mkdir ${DEST}/debconf
33 +echo "Backuping data from $BDIR"
34 +# the following line clears the last weeks incremental directory
35 +[ -d $DEST/emptydir ] || mkdir $DEST/emptydir
36 +rsync --delete -a $DEST/emptydir/ $DEST/$BACKUPDIR/
39 +# now the actual transfer
40 +rsync $OPTS $BDIR $DEST/current
42 +echo "Dumping database"
43 +su -s /bin/bash postgres -c "pg_dump -F c -d gforge" | gzip -c > ${DEST}/postgres/gforge.dump.gz
45 +echo "Dumping debconf keys"
48 + debconf-copydb configdb stdout -c Name:stdout -c Driver:Pipe -c InFd:none \
49 + --pattern='^'${PAT}'/' > ${DEST}/debconf/${PAT}.txt
50 + chmod 0700 ${DEST}/debconf/${PAT}.txt
52 diff -Naur gforge-4.5.3n7/debian/gforge-db-postgresql.cron.d gforge-4.5.3n7-backups/debian/gforge-db-postgresql.cron.d
53 --- gforge-4.5.3n7/debian/gforge-db-postgresql.cron.d 2005-11-21 09:57:21.788406352 +0100
54 +++ gforge-4.5.3n7-backups/debian/gforge-db-postgresql.cron.d 2005-11-21 10:11:28.359707952 +0100
57 # Hourly update of quotas
58 0 * * * * root [ -x /usr/share/gforge/bin/quota_update.pl ] && /usr/share/gforge/bin/quota_update.pl > /dev/null 2>&1
60 +# Daily incremental backup to /backup
61 +15 23 * * * root [ -x /usr/share/gforge/bin/gforge-db-backup.sh ] && /usr/share/gforge/bin/gforge-db-backup.sh > /dev/null 2>&1
62 diff -Naur gforge-4.5.3n7/debian/rules gforge-4.5.3n7-backups/debian/rules
63 --- gforge-4.5.3n7/debian/rules 2005-11-21 09:57:21.789406200 +0100
64 +++ gforge-4.5.3n7-backups/debian/rules 2005-11-21 10:08:29.533893608 +0100
66 install -m 755 cronjobs/massmail.php $(CURDIR)/debian/gforge-db-postgresql/usr/share/gforge/bin/
67 install -m 755 cronjobs/vacuum.php $(CURDIR)/debian/gforge-db-postgresql/usr/share/gforge/bin/
68 install -m 755 cronjobs/quota_update.pl $(CURDIR)/debian/gforge-db-postgresql/usr/share/gforge/bin/
69 + install -m 755 cronjobs/gforge-db-backup.sh $(CURDIR)/debian/gforge-db-postgresql/usr/share/gforge/bin/
70 install -m 755 deb-specific/stats_projects_logparse.pl $(CURDIR)/debian/gforge-db-postgresql/usr/share/gforge/bin/
71 install -m 755 deb-specific/get_news_notapproved.pl $(CURDIR)/debian/gforge-db-postgresql/usr/share/gforge/bin/
72 install -m 755 deb-specific/install-db.sh $(CURDIR)/debian/gforge-db-postgresql/usr/share/gforge/bin/