]> git.decadent.org.uk Git - dak.git/blob - cron.daily
auric implementation
[dak.git] / cron.daily
1 #! /bin/sh
2 #
3 # Executed daily via cron, out of troup's crontab.
4
5 set -e
6 export SCRIPTVARS=/org/ftp.debian.org/katie/vars
7 . $SCRIPTVARS
8
9 ################################################################################
10
11 echo Archive maintenance started at $(date +%X)
12
13 NOTICE="$ftpdir/Archive_Maintenance_In_Progress"
14
15 cleanup() {
16   rm -f "$NOTICE"
17 }
18 trap cleanup 0
19
20 rm -f "$NOTICE"
21 cat > "$NOTICE" <<EOF
22 Packages are currently being installed and indices rebuilt.
23 Maintenance is automatic, starting at 13:52 US Central time, and
24 ending at about 15:30.  This file is then removed.
25
26 You should not mirror the archive during this period.
27 EOF
28
29 ################################################################################
30
31 echo "Creating pre-daily-cron-job backup of projectb database..."
32 pg_dump projectb > /org/ftp.debian.org/backup/dump_$(date +%Y.%m.%d-%H:%M:%S)
33
34 ################################################################################
35
36 update-bugdoctxt
37 update-mirrorlists
38
39 ################################################################################
40
41 # temporary hack to work around the lack of an apt-utils & python-apt package
42 export PYTHONPATH=$PYTHONPATH:/org/ftp.debian.org/scripts/apt/build/bin/
43 export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/org/ftp.debian.org/scripts/apt/build/bin/
44 export PATH=$PATH:/org/ftp.debian.org/scripts/apt/build/bin/
45
46 cd $incoming
47 rm -f REPORT
48 katie -pak *.changes | direport | tee REPORT | \
49      mail -s "Install for $(date +%D)" ftpmaster@ftp-master.debian.org
50 chgrp debadmin REPORT
51 chmod 664 REPORT
52
53 cd $masterdir
54 symlinks -d -r $ftpdir
55
56 cd $masterdir
57 jenna
58 # FIXME
59 cd /org/ftp.debian.org/database/dists/
60 for i in proposed-updates_-_binary-*; do cat $i >> proposed-updates_-_binary.list; done
61 cd $masterdir
62 apt-ftparchive generate apt.conf
63 rhona
64 cd $indices
65 charisma > .new-maintainers
66 mv -f .new-maintainers Maintainers
67 gzip -9v <Maintainers >.new-maintainers.gz
68 mv -f .new-maintainers.gz Maintainers.gz
69 cd $masterdir
70 copyoverrides
71 mklslar
72 mkchecksums
73
74 rm -f $NOTICE
75 echo Archive maintenance finished at $(date +%X)
76
77 ################################################################################
78
79 echo "Creating post-daily-cron-job backup of projectb database..."
80 pg_dump projectb > /org/ftp.debian.org/backup/dump_$(date +%Y.%m.%d-%H:%M:%S)
81
82 ################################################################################
83
84 ulimit -m 90000 -d 90000 -s 10000 -v 90000
85
86 run-parts --report /org/ftp.debian.org/scripts/distmnt
87
88 echo Daily cron scripts successful.