initial checkin of new hdw-linux development cvs repository
[hdw-linux/hdw-linux.git] / packages / hackbard / cron / cron
1 # hdw - linux cron package
2 #
3 # author: hackbard@hackdaworld.dyndns.org
4 #
5 # [V] 3.0pl1
6 # [S] 3-1
7 # [D] cron3.0pl1.tar.gz ftp://metalab.unc.edu/pub/Linux/system/daemons/cron/
8
9 post_install()  {
10         # crontab file
11         cat > $root/etc/crontab << EOS
12 # hdw - linux /etc/crontab
13 #
14 SHELL=/bin/sh
15 PATH=/bin:/sbin:/usr/bin:/usr/sbin
16 MAILTO=""
17
18 # hdw - linux daily stuff executed at 5 am
19 0 5 * * * -x /etc/cron.d/hdw.daily && /etc/cron.d/hdw.daily
20
21 # add your rules !
22 EOS
23
24         # crontab extension's files
25         mkdir -p $root/etc/cron.d
26         cat > $root/etc/cron.d/hdw.daily << EOS
27 # hdw - linux /etc/cron.d/hdw.daily
28 #
29 echo "updating system status"
30 echo "+ ldconfig"   ; ldconfig
31 echo "+ makewhatis" ; makewhatis
32 echo "+ updatedb"   ; updatedb --prunepaths='/tmp /var/tmp /proc /dev /mnt'
33 echo "+ depmod -a"  ; depmod -a
34 echo "+ listing core files"
35     for core in \`find / -type f -name core\` ; do
36         echo "  - \$core"
37     done
38 echo "done."
39 EOS
40         # permissions
41         chmod 600 $root/etc/crontab
42         chmod 700 $root/etc/cron.d/*
43                 }