Electronics and Software›Configuration change
#28550
Missing some log history in /virgoLog/Old/
While scanning the log files stored in the "long term" area:
/virgoLog/Old/
It was discovered that some log history was missing.
This corresponded to "logrotated" files (*.log.1 - *.log.5) wich were overwritten.
Logrotation was introduced in order to deal with logfiles wich could reach very big sizes and then become difficult to manage and occupy too much disk space (maximum size limited to 50Mb)
After some investigation it has been uderstood that this was due to a problem into the existing ctrontab job running on the monitor machine and dealing with /virgoLog cleanup and copy to /virgoLog/Old/ area.
The existing cronjob was this way:
30 4 * * * find /virgoLog -name '*.*log*' -mtime +30 -type f -exec rm -f {} \;
35 4 * * * find /virgoLog -name '*.*log.5' -mtime +3 -type f -exec rm -f {} \;
..........
0 11 * * * rsync -Cav --exclude="/virgoLog/Old" --exclude="/virgoLog/Subsystems" /virgoLog st3::virgoOLD
The problem was that files like *.log.1 were removed after 30 days, then the logrotate would generate them again with the same extension .1 and then the rsync would ovewrite the file into /virgoLog/Old
By increasing the rotate count to 9 and changing cron statements into:
30 4 * * * find /virgoLog -name '*.*log' -mtime +30 -type f -exec rm -f {} \;
35 4 * * * find /virgoLog -name '*.*log.[1-8]' -mtime +180 -type f -exec rm -f {} \;
40 4 * * * find /virgoLog -name '*.*log.9' -mtime +3 -type f -exec rm -f {} \;
problem should be solved.
The problem will occur again only for the .9 file, but this should correspond to patologic situation