Update to 1.3, allow to add increase history and to compress logs easily

Approved by:	jdp (maintainer)
This commit is contained in:
Mathieu Arnold 2004-03-16 17:35:06 +00:00
parent 5b56c6906f
commit 3a90ce4e5c
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=104192
2 changed files with 16 additions and 11 deletions

View File

@ -6,8 +6,7 @@
#
PORTNAME= cvsup-mirror
PORTVERSION= 1.2
PORTREVISION= 1
PORTVERSION= 1.3
CATEGORIES= net
DISTFILES=

View File

@ -11,18 +11,24 @@ export PATH=/bin:/usr/bin:${PREFIX}/bin
lock=/var/spool/lock/cvsup.lock
log=/var/log/cvsup.log
num_logs=8
use_gzip=0
if [ ${use_gzip} != 0 ]
then
gz_ext=.gz
fi
# Rotate the log files
umask 22
test -f ${log}.7 && mv -f ${log}.7 ${log}.8
test -f ${log}.6 && mv -f ${log}.6 ${log}.7
test -f ${log}.5 && mv -f ${log}.5 ${log}.6
test -f ${log}.4 && mv -f ${log}.4 ${log}.5
test -f ${log}.3 && mv -f ${log}.3 ${log}.4
test -f ${log}.2 && mv -f ${log}.2 ${log}.3
test -f ${log}.1 && mv -f ${log}.1 ${log}.2
test -f ${log}.0 && mv -f ${log}.0 ${log}.1
test -f ${log} && mv -f ${log} ${log}.0
for i in $(/usr/bin/jot ${num_logs} $((num_logs-1)) 0)
do
test -f ${log}.$i${gz_ext} && mv -f ${log}.$i${gz_ext} ${log}.$((i+1))${gz_ext}
done
test -f ${log} && mv -f ${log} ${log}.0 && [ ${use_gzip} != 0 ] && /usr/bin/gzip -9 ${log}.0
exec >${log} 2>&1
# Do the update