]> git.decadent.org.uk Git - dak.git/blob - config/debian-security/cron.daily
Use zcat and only uncompress the files we need. also makes it better for rsync, as...
[dak.git] / config / debian-security / cron.daily
1 #!/bin/sh
2 #
3 # Executed daily via cron, out of dak's crontab.
4
5 set -e
6 export SCRIPTVARS=/org/security.debian.org/dak/config/debian-security/vars
7 . $SCRIPTVARS
8
9 ################################################################################
10
11 # Fix overrides
12
13 rsync --delete -r --include=override\* --exclude=\* --password-file /srv/non-us.debian.org/s3kr1t/rsync-password -ql security-master@ftp-master::indices/ $overridedir
14
15 cd $overridedir
16 find . -maxdepth 1 -mindepth 1 -type l | xargs --no-run-if-empty rm
17
18 for suite in $suites; do
19     case $suite in
20                 oldstable) override_suite=sarge;;
21                 stable) override_suite=etch;;
22                 testing) override_suite=lenny;;
23                 *) echo "Unknown suite type ($suite)"; exit 1;;
24     esac
25     for component in $components; do
26                 for override_type in $override_types; do
27                         case $override_type in
28                                 deb) type="" ;;
29                                 dsc) type=".src" ;;
30                                 udeb) type=".debian-installer" ;;
31                         esac
32
33                         if [ "$override_type" = "udeb" ]; then
34                                 if [ ! "$component" = "main" ]; then
35                                         continue
36                                 fi
37                         fi
38                         zcat override.$override_suite.$component$type.gz | dak control-overrides -q -a -t $override_type -s $suite -c updates/$component
39                 done
40     done
41 done
42
43 # Generate .all3 overides for the buildd support
44 for dist in etch lenny; do
45     rm -f override.$dist.all3
46     components="main contrib non-free";
47     if [ -f override.$dist.main.debian-installer.gz ]; then
48                 components="$components main.debian-installer"
49     fi
50     for component in $components; do
51                 zcat override.$dist.$component.gz >> override.$dist.all3
52         if [ -e "override.$dist.$component.src.gz" ]; then
53                         zcat override.$dist.$component.src.gz >> override.$dist.all3.src
54                 fi
55     done
56 done
57
58 ################################################################################
59
60 # Freshen Packages-Arch-Specific
61 wget -qN http://buildd.debian.org/quinn-diff/Packages-arch-specific -O $base/buildd/Packages-arch-specific
62
63 ################################################################################
64
65 cd $masterdir
66 dak clean-queues
67 dak clean-suites
68 apt-ftparchive -q clean apt.conf
69 apt-ftparchive -q clean apt.conf.buildd
70
71 symlinks -d -r $ftpdir
72
73 pg_dump obscurity > /org/security.debian.org/dak-backup/dump_$(date +%Y.%m.%d-%H:%M:%S)
74
75 # Vacuum the database
76 set +e
77 echo "VACUUM; VACUUM ANALYZE;" | psql obscurity 2>&1 | egrep -v "^NOTICE:  Skipping \"pg_.*only table or database owner can VACUUM it$|^VACUUM$"
78 set -e
79
80 ################################################################################