chiark / gitweb /
wip compile
[inn-innduct.git] / expire / expirerm.in
1 #! /bin/sh
2 # fixscript will replace this line with code to load innshellvars
3
4 ##  Remove articles listed by expire -z.
5 ##  Remove all files specified in the input file.
6
7 MAIL="${MAILCMD} -s 'Problem removing expired files' ${NEWSMASTER}"
8
9 #RMPROC="xargs rm"
10 RMPROC="fastrm -e ${SPOOL}"
11
12 if [ -z "$1" ] ; then
13     echo "Expire called with zero list of files on `hostname`" \
14   | eval ${MAIL}
15     exit 0
16 fi
17 if [ ! -f $1 ] ; then
18     echo "Expire called with no files to expire on `hostname`" \
19   | eval ${MAIL}
20     exit 0
21 fi
22
23 eval "cd ${SPOOL} \
24     && ${RMPROC} <$1 \
25     && mv $1 ${MOST_LOGS}/expire.list"
26 if [ -f $1 ] ; then
27     echo "Expire had problems removing articles on `hostname`" \
28         | eval ${MAIL}
29     exit 1
30 fi