Hi Chris,
> just a quick one. On one of my production systems I have a very large
> number of XML log files in
> "/usr/local/PKI_NAME/openca/var/log/xml/time/2005". I don't need or
> use these records, so want to delete them. Is there any issue in me:
>
> 1. Stopping OpenCA
> 2. Deleteing the /usr/local/PKI_NAME/openca/var/log/xml/time/2005/*
> tree
> 3. Starting OpenCA
>
> will OpenCA rebuild any indexes to the old log files to keep it's
> integrity ?
you can clean up the XML logfiles even without restarting OpenCA. I
have been using the following shell code fragment to automatically
clean up old logfiles (invoked daily by cron).
cu
Martin
----
FIND=find
TAR=tar
XARGS=xargs
RM=rm
KEEPDAYS=7
OPENCA_HOME=/usr/local/openca-0.9.2
# write all files/links older than n days to the specified
archive
# directory and remove the archived files
( cd $OPENCA_HOME && \
$FIND var/log/ \
\( -type l -o -type f \) \
-name \*.xml -mtime +$KEEPDAYS | \
$TAR czvf "$1" --files-from - 2>/dev/null | \
$XARGS $RM -f \
)
# purge empty log directories:
# for each directory below log/xml/time that has zero real
files
# or symlinks below it remove the directory hierarchy below
( cd $OPENCA_HOME && \
for i in `$FIND var/log/xml/time -type d -maxdepth 3
2>/dev/null` ; do
if [ -d "$i" -a `$FIND "$i" -type f -o -type
l 2>/dev/null | $WC -l` = 0 ] ; then
$RM -rf "$i"
fi
done
)
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Openca-Users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openca-users