1# prefix is inserted above by make
2
3#
4#	back_act will maintain a set of `old' active files
5#	in the DB directory where they can be used by nngoback
6#	to backtrack the rc file a number of days.
7#
8#	It should be invoked by cron every day at midnight.
9#	It should run as user `news'!
10#
11#	Call:  back_act [days]
12#	Default: keep copy of active file for the last 14 days.
13
14cd $DB || exit 1
15
16p=${1-15}
17l=""
18while [ "$p" -gt 0 ]
19do
20	i="`expr $p - 1`"
21	if [ -f active.$i ]
22	then
23		mv active.$i active.$p
24		l=$p
25	elif [ -n "$l" ]
26	then
27		ln active.$l active.$p
28	fi
29	p=$i
30done
31
32cp $ACTIVE active.0
33chmod 644 active.0
34