File: cron.weekly

package info (click to toggle)
cvs 1.10.7-1.99.slink.y2k.1
  • links: PTS
  • area: main
  • in suites: slink
  • size: 8,892 kB
  • ctags: 5,463
  • sloc: ansic: 68,307; sh: 17,664; makefile: 1,640; perl: 902; yacc: 826; csh: 181; lisp: 7
file content (50 lines) | stat: -rw-r--r-- 845 bytes parent folder | download
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
50
#!/bin/sh

#
# CVS cron.weekly script
#

# Get the configuration file
if test ! -f /etc/cvs.conf; then
	exit 0
fi

. /etc/cvs.conf

[ "$CVSCONF_VERSION" = "none" ] && exit 0
[ $CVSCONF_VERSION -gt 2 ] && exit 0

# Should we rotate any logfiles?
if test "$CVS_ROTATE" = "no"; then
	exit 0
fi

# Simple syntax
if test "$CVS_ROTATE" = "yes"; then
	OLDIFS="$IFS"
	IFS=": 	"
	for i in $CVS_ROTDIRS; do
		/usr/bin/savelog -p -t -c 7 $i/CVSROOT/history >/dev/null 2>&1
	done
	IFS="$OLDIFS"
else
	# Advanced syntax
	OLDIFS="$IFS"
	IFS=": 	"
	for i in $CVS_ROTATE; do
		IFS="$OLDIFS"
		DIR="`echo $CVS_ROTDIRS | sed 's/\([^:]*\):.*/\1/'`"
		CVS_ROTDIRS="`echo $CVS_ROTDIRS | sed 's/[^:]*:\(.*\)/\1/'`"
		case "$i" in
			n)
			continue
			;;
			
			[0-9]*)
			savelog -p -t -c $i $DIR/CVSROOT/history >/dev/null 2>&1
			;;
		esac
	done
fi

# End of file.