X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=config%2Fdebian%2Fcron.daily;h=059020eb8d521c6c0048876ed3d0396e8be01e7c;hb=7aac641ca31157f344f6823507c6cc251958d0b5;hp=6d115cbeffa92e04e69ad298d149f7b5fc9c4b0d;hpb=11cdb7b061b7ae8aadbc3bd6da3cc796bb00396c;p=dak.git diff --git a/config/debian/cron.daily b/config/debian/cron.daily index 6d115cbe..059020eb 100755 --- a/config/debian/cron.daily +++ b/config/debian/cron.daily @@ -199,4 +199,16 @@ TS=$(($TS+1)); echo Archive maintenance timestamp $TS: $(date +%X) cd $configdir apt-ftparchive -q clean apt.conf +TS=$(($TS+1)); echo Archive maintenance timestamp $TS: $(date +%X) + +# Compress psql backups older than a month, but no more than 20 of them + +(cd $base/backup/ + find -maxdepth 1 -mindepth 1 -type f -name 'dump_*' \! -name '*.bz2' \! -name '*.gz' -mtime +30 | + sort | head -n20 | while read dumpname; do + echo "Compressing $dumpname" + bzip2 -9 "$dumpname" + done +) + ################################################################################