File: addcron

package info (click to toggle)
gnats 3.113-13
  • links: PTS
  • area: main
  • in suites: potato
  • size: 5,640 kB
  • ctags: 2,917
  • sloc: ansic: 25,624; tcl: 8,071; sh: 5,362; perl: 3,619; makefile: 3,164; yacc: 820; lisp: 742; sql: 280; sed: 181
file content (40 lines) | stat: -rw-r--r-- 808 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/bin/bash

set -e

###############################################################################
#
# Add the `gnats' system into cron
#

CRON_ALLOW='/etc/cron.allow'
AT_ALLOW='/etc/at.allow'

if [ "$1" = configure ]; then

  #
  # Make sure gnats has cron & at access
  #

  if [ -f $CRON_ALLOW ] && \
     [ $(protect fgrep -c gnats $CRON_ALLOW) -eq 0 ]; then
    echo 'gnats' >>$CRON_ALLOW
#    echo "- \`gnats' has been added to the cron.allow file"
  fi

  if [ -f $AT_ALLOW ] && \
     [ $(protect fgrep -c gnats $AT_ALLOW) -eq 0 ]; then
    echo 'gnats' >>$AT_ALLOW
#    echo "- \`gnats' has been added to the at.allow file"
  fi

  #
  # Add the `gnats' crontab file
  #

  crontab -u gnats - <<EOF
5,15,25,35,45,55 * * * * /usr/lib/gnats/queue-pr --run
10 3 * * * /usr/lib/gnats/check-db
EOF

fi