File: leafnode.cron.daily

package info (click to toggle)
leafnode 1.11.11-3
  • links: PTS
  • area: main
  • in suites: bullseye
  • size: 2,460 kB
  • sloc: ansic: 10,914; sh: 1,748; xml: 628; makefile: 296; perl: 84; sed: 4
file content (49 lines) | stat: -rw-r--r-- 1,680 bytes parent folder | download | duplicates (6)
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
41
42
43
44
45
46
47
48
49
#!/bin/sh
#
# Leafnode cron job. To be run daily.
# By Joey Hess <joeyh@master.debian.org>
# with bugs by Mark Brown <broonie@debian.org>

# Get configuration
. /etc/news/leafnode/debian-config

# Do the cd so that it doesn't matter if we cannot read /root.
cd /

# Expire old news.
# Ignores the messages texpire generates to stdout about which articles it
# expires. If you'd rather get that info mailed to you, remove the >/dev/null
if [ -x /usr/sbin/texpire ]; then
   su news -s /bin/sh -c "/usr/sbin/texpire" >/dev/null
fi

# Run touch_newsgroups if the user wants it and we can
if [ -x /usr/bin/touch_newsgroup -a -f /etc/news/leafnode/touch_groups ]; then
   if /usr/bin/perl -MNet::NNTP < /dev/null 2>/dev/null ; then
      su news -s /bin/sh -c "/usr/bin/touch_newsgroup -f /etc/news/leafnode/touch_groups"
   else
      cat << EOF
      You have requested that touch_newsgroup be run to mark the groups 
      listed in /etc/news/leafnode/touch_groups as read.  This requires
      that both perl and the Net::NNTP module (part of libnet-perl) are
      avalible, which does not appear to be the case:

EOF
      /usr/bin/perl -MNet::NNTP < /dev/null
   fi
fi

# generate mail about any failed postings.
if [ "" != "`ls /var/spool/news/failed.postings/ 2>/dev/null`" ]; then
   cat << EOF
Some articles posted via Leafnode have been placed in the
failed.postings directory.  This typically means that they were
rejected by one or more of the upstream news servers.  Examining the
news log files should provide some indication as to why.

To retry the posting move the queue files into /var/spool/news/out.going
and run /usr/sbin/fetchnews.

EOF
   /usr/bin/newsq -f
fi