Update to 1.3, allow to add increase history and to compress logs easily
Approved by: jdp (maintainer)
This commit is contained in:
parent
5b56c6906f
commit
3a90ce4e5c
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=104192
@ -6,8 +6,7 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
PORTNAME= cvsup-mirror
|
PORTNAME= cvsup-mirror
|
||||||
PORTVERSION= 1.2
|
PORTVERSION= 1.3
|
||||||
PORTREVISION= 1
|
|
||||||
CATEGORIES= net
|
CATEGORIES= net
|
||||||
DISTFILES=
|
DISTFILES=
|
||||||
|
|
||||||
|
@ -11,18 +11,24 @@ export PATH=/bin:/usr/bin:${PREFIX}/bin
|
|||||||
lock=/var/spool/lock/cvsup.lock
|
lock=/var/spool/lock/cvsup.lock
|
||||||
log=/var/log/cvsup.log
|
log=/var/log/cvsup.log
|
||||||
|
|
||||||
|
num_logs=8
|
||||||
|
use_gzip=0
|
||||||
|
|
||||||
|
if [ ${use_gzip} != 0 ]
|
||||||
|
then
|
||||||
|
gz_ext=.gz
|
||||||
|
fi
|
||||||
|
|
||||||
# Rotate the log files
|
# Rotate the log files
|
||||||
|
|
||||||
umask 22
|
umask 22
|
||||||
test -f ${log}.7 && mv -f ${log}.7 ${log}.8
|
|
||||||
test -f ${log}.6 && mv -f ${log}.6 ${log}.7
|
for i in $(/usr/bin/jot ${num_logs} $((num_logs-1)) 0)
|
||||||
test -f ${log}.5 && mv -f ${log}.5 ${log}.6
|
do
|
||||||
test -f ${log}.4 && mv -f ${log}.4 ${log}.5
|
test -f ${log}.$i${gz_ext} && mv -f ${log}.$i${gz_ext} ${log}.$((i+1))${gz_ext}
|
||||||
test -f ${log}.3 && mv -f ${log}.3 ${log}.4
|
done
|
||||||
test -f ${log}.2 && mv -f ${log}.2 ${log}.3
|
|
||||||
test -f ${log}.1 && mv -f ${log}.1 ${log}.2
|
test -f ${log} && mv -f ${log} ${log}.0 && [ ${use_gzip} != 0 ] && /usr/bin/gzip -9 ${log}.0
|
||||||
test -f ${log}.0 && mv -f ${log}.0 ${log}.1
|
|
||||||
test -f ${log} && mv -f ${log} ${log}.0
|
|
||||||
exec >${log} 2>&1
|
exec >${log} 2>&1
|
||||||
|
|
||||||
# Do the update
|
# Do the update
|
||||||
|
Loading…
Reference in New Issue
Block a user