]> git.decadent.org.uk Git - dak.git/blob - cron.daily-non-US
sync
[dak.git] / cron.daily-non-US
1 #! /bin/sh
2 #
3 # Executed daily via cron, out of troup's crontab.
4
5 set -e
6 export SCRIPTVARS=/org/non-us.debian.org/katie/vars-non-US
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/non-us.debian.org/backup/dump_$(date +%Y.%m.%d-%H:%M:%S)
33
34 ################################################################################
35
36 # temporary hack to work around the lack of an apt-utils & python-apt package
37 export PYTHONPATH=$PYTHONPATH:/org/non-us.debian.org/scripts/apt/build/bin/
38 export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/org/non-us.debian.org/scripts/apt/build/bin/
39 export PATH=$PATH:/org/non-us.debian.org/scripts/apt/build/bin/
40
41 cd $incoming
42 rm -f REPORT
43 katie -pak *.changes | direport | tee REPORT | \
44      mail -s "Non-US Install for $(date +%D)" ftpmaster@ftp-master.debian.org
45 chgrp debadmin REPORT
46 chmod 664 REPORT
47
48 cd $masterdir
49 symlinks -d -r $ftpdir
50
51 cd $masterdir
52 jenna
53 # FIXME
54 cd /org/non-us.debian.org/database/dists/
55 for i in proposed-updates_-_binary-*; do cat $i >> proposed-updates_-_binary.list; done
56
57 # Generate override files
58 cd $overridedir
59 denise
60 # FIXME
61 rm -f override.potato.all3
62 for i in main contrib non-free; do cat override.potato.$i >> override.potato.all3; done
63
64 # Generate Packages and Sources files
65 cd $masterdir
66 apt-ftparchive generate apt.conf-non-US
67
68 # Clean out old packages
69 rhona
70
71 cd $indices
72 charisma > .new-maintainers
73 mv -f .new-maintainers Maintainers
74 gzip -9v <Maintainers >.new-maintainers.gz
75 mv -f .new-maintainers.gz Maintainers.gz
76 cd $masterdir
77 copyoverrides
78 mklslar
79 mkchecksums
80
81 rm -f $NOTICE
82 echo Archive maintenance finished at $(date +%X)
83
84 ################################################################################
85
86 echo "Creating post-daily-cron-job backup of projectb database..."
87 pg_dump projectb > /org/non-us.debian.org/backup/dump_$(date +%Y.%m.%d-%H:%M:%S)
88
89 ################################################################################
90
91 ulimit -m 90000 -d 90000 -s 10000 -v 90000
92
93 run-parts --report /org/non-us.debian.org/scripts/distmnt
94
95 echo Daily cron scripts successful.