From: Joerg Jaspert Date: Sun, 5 Apr 2009 21:26:32 +0000 (+0200) Subject: dinstall X-Git-Url: https://git.decadent.org.uk/gitweb/?a=commitdiff_plain;h=2881a67e116449cd49495faad6c3152cdab8fbb7;p=dak.git dinstall name the pre dumps differently. delete predumps after 2 days. also compress the dumpall files hardlink same files. Signed-off-by: Joerg Jaspert --- diff --git a/config/debian/cron.dinstall b/config/debian/cron.dinstall index 9c9840d7..045b6a04 100755 --- a/config/debian/cron.dinstall +++ b/config/debian/cron.dinstall @@ -74,7 +74,7 @@ function merkel1() { # Create the postgres dump files function pgdump_pre() { log "Creating pre-daily-cron-job backup of projectb database..." - pg_dump projectb > $base/backup/dump_$(date +%Y.%m.%d-%H:%M:%S) + pg_dump projectb > $base/backup/dump_pre_$(date +%Y.%m.%d-%H:%M:%S) } function pgdump_post() { @@ -329,11 +329,19 @@ function aptftpcleanup() { function compress() { log "Compress old psql backups" cd $base/backup/ - find -maxdepth 1 -mindepth 1 -type f -name 'dump_*' \! -name '*.bz2' \! -name '*.gz' -mtime +1 | + find -maxdepth 1 -mindepth 1 -type f -name 'dump_pre_*' -mtime +2 -print0 | xargs -0 --no-run-if-empty rm + + find -maxdepth 1 -mindepth 1 -type f -name 'dump_*' \! -name '*.bz2' \! -name '*.gz' -mmin 720 | + while read dumpname; do + echo "Compressing $dumpname" + bzip2 -9v "$dumpname" + done + find -maxdepth 1 -mindepth 1 -type f -name "dumpall_*" \! -name '*.bz2' \! -name '*.gz' -mmin 720 | while read dumpname; do echo "Compressing $dumpname" bzip2 -9v "$dumpname" done + finddup -l -d $base/backup } function logstats() {