X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=config%2Fdebian%2Fdinstall.functions;h=587df1b5d07bc3f151db18590c37cba8ede1dcfd;hb=1eb18077dfc10f7ba80a94fc2e85c79b944e4d61;hp=1834841b74b1ad04505b0aca1e093f63d92af4eb;hpb=6cb0b0401eaeeb6900551c20617f0a8f2293cd89;p=dak.git diff --git a/config/debian/dinstall.functions b/config/debian/dinstall.functions index 1834841b..587df1b5 100644 --- a/config/debian/dinstall.functions +++ b/config/debian/dinstall.functions @@ -4,14 +4,14 @@ function ts() { echo "Archive maintenance timestamp ($1): $(date +%H:%M:%S)" } -# Remove all locks -function remove_locks() { - rm -f $LOCK_DAILY $LOCK_ACCEPTED $LOCK_NEW +# Remove daily lock +function remove_daily_lock() { + rm -f $LOCK_DAILY } -# trap handler for cleaning up on signal / error -function cleanup() { - remove_locks +# Remove all locks +function remove_all_locks() { + rm -f $LOCK_DAILY $LOCK_ACCEPTED $LOCK_NEW } # If we error out this one is called, *FOLLOWED* by cleanup above @@ -209,6 +209,7 @@ function packages() { cd $configdir #apt-ftparchive generate apt.conf dak generate-packages-sources + dak contents generate } function pdiff() { @@ -439,7 +440,7 @@ function mirror() { echo "Running on host: $(hostname -f)" >> ${TRACEFILE} echo "Archive serial: ${SERIAL}" >> ${TRACEFILE} cd ${mirrordir} - rsync -aH --link-dest ${ftpdir} --delete --delete-after --ignore-errors ${ftpdir}/. . + rsync -aH --link-dest ${ftpdir} --delete --delete-after --delete-excluded --exclude Packages.*.new --exclude Sources.*.new --ignore-errors ${ftpdir}/. . } function expire() { @@ -525,16 +526,11 @@ function compress() { cd $base/backup/ 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 -9fv "$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 -9fv "$dumpname" - done + find -maxdepth 1 -mindepth 1 -type f -name 'dump_*' \! -name '*.bz2' \! -name '*.gz' \! -name '*.xz' -mmin +720 -print0 \ + | xargs --no-run-if-empty -0 -P4 -n16 xz -9v + + find -maxdepth 1 -mindepth 1 -type f -name "dumpall_*" \! -name '*.bz2' \! -name '*.gz' \! -name '*.xz' -mmin +720 \ + | xargs --no-run-if-empty -0 -P4 -n16 xz -9v finddup -l -d $base/backup }