X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=cron.weekly;h=18d4162b6cb56de09899d916aaad474b64edfd6e;hb=8e9a5d533c8458eaca33266208f6c347d66dfeef;hp=bafca02ecdbc9905429421852112fbff09d945e8;hpb=e8eacb00ee41d7ab974ba913fff40e5c082b8e1a;p=dak.git diff --git a/cron.weekly b/cron.weekly index bafca02e..18d4162b 100755 --- a/cron.weekly +++ b/cron.weekly @@ -1,6 +1,6 @@ #!/bin/sh # -# Run once a week via cron, out of troup's crontab. +# Run once a week via cron, out of katie's crontab. set -e export SCRIPTVARS=/org/ftp.debian.org/katie/vars @@ -8,25 +8,15 @@ export SCRIPTVARS=/org/ftp.debian.org/katie/vars ################################################################################ -echo "Creating pre-weekly-cron-job backup of projectb database..." -pg_dump projectb > /org/ftp.debian.org/backup/dump_$(date +%Y.%m.%d-%H:%M:%S) +# Purge empty directories -################################################################################ +if [ ! -z "$(find $ftpdir/pool/ -type d -empty)" ]; then + find $ftpdir/pool/ -type d -empty | xargs rmdir; +fi -# temporary hack to work around the lack of an apt-utils & python-apt package -export PYTHONPATH=$PYTHONPATH:/org/ftp.debian.org/scripts/apt/build/bin/ -export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/org/ftp.debian.org/scripts/apt/build/bin/ -export PATH=$PATH:/org/ftp.debian.org/scripts/apt/build/bin/ +# Clean up apt-ftparchive's databases cd $masterdir -shania -v -shania -v -m -i $incoming - -# TODO: weekly postins to d-c (?), backup of report (?), backup of changes.tgz (?) - -################################################################################ - -echo "Creating post-weekly-cron-job backup of projectb database..." -pg_dump projectb > /org/ftp.debian.org/backup/dump_$(date +%Y.%m.%d-%H:%M:%S) +apt-ftparchive -q clean apt.conf ################################################################################