Bug 889751
Summary: | engine: engine log have same time on all the rotated logs from the same date | ||
---|---|---|---|
Product: | Red Hat Enterprise Virtualization Manager | Reporter: | Dafna Ron <dron> |
Component: | ovirt-engine | Assignee: | Ofer Schreiber <oschreib> |
Status: | CLOSED CURRENTRELEASE | QA Contact: | Dušan Kajan <dkajan> |
Severity: | high | Docs Contact: | |
Priority: | unspecified | ||
Version: | 3.1.0 | CC: | dyasny, hateya, iheim, lpeer, mgoldboi, pstehlik, Rhev-m-bugs, sgrinber, yeylon, ykaul |
Target Milestone: | --- | ||
Target Release: | 3.2.0 | ||
Hardware: | x86_64 | ||
OS: | Linux | ||
Whiteboard: | integration | ||
Fixed In Version: | sf15 | Doc Type: | Bug Fix |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | Type: | Bug | |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: | |||
Bug Depends On: | |||
Bug Blocks: | 915537 |
Description
Dafna Ron
2012-12-23 09:51:52 UTC
Modification time has too change, since when you rotate you change all the files. At the rotation point: .logN is renamed to log.N+1 . . .log2 is renamed to log.3 .log1 is renamed to log.2 .log is renamed to log.1 new .log is created. So ls -ltr has to change due to the fact this is probably done with mv. What I fail to understand is why the time stamp in the file name the same, it was most likely introduced to overcome the above and provide indication on the actual date the file was first rotated from .log to .log.n.zip. But instead it is modified to the last rotation time for all files. This should be fixed. Looking at bug 889796 the said above is not accurate, it looks like the rotation itself does not have to lead to the same time on all the files. Simon, look at /usr/share/ovirt-engine/scripts/ovirtlogrot.sh and you'll understand why they all have the same exact timestamp: dateformat="+%Y%m%d_%H" date=`date $dateformat` for i in `ls $logdir/engine.log.* -t`; do m=`expr match $i .*gz` if [ $m == 0 ] then cat $i | gzip -9 > $i-$date.gz && rm $i fi done; Probably better changed to something like: dateformat="+%Y%m%d_%H%M%S" for i in `ls $logdir/engine.log.* -t`; do m=`expr match $i .*gz` if [ $m == 0 ] then date=`date $dateformat` cat $i | gzip -9 > $i-$date.gz && rm $i fi done; (In reply to comment #5) The suggested code which provides a better granularity on the time the script actually started the zip will not solve the issue -> you will now have the order the files where zipped, not more then that. What the script needs to do it to take the original creation date of $i (the compressed file) and use it as the $date for the zipped file. Something like: date=$(stat -c %y $i) And remove the white spaces Not sure what further information is requested from me. Patch is posted for review: http://gerrit.ovirt.org/#/c/10810/ Merged upstream: http://gerrit.ovirt.org/gitweb?p=ovirt-engine.git;a=commit;h=7902858f6c8d1d3d8f2b40a7d5bdf229f3d47689 Patch is posted for review: http://gerrit.ovirt.org/#/c/10846/ FailedQA - sf11 On clean setup there are NO "engine|jasperserver|server.log.*" files yet. So 'if' condition is skipped. "engine.log.*" doesn't match "engine.log" [root@myserver]# /etc/cron.daily/ovirt-cron ls: cannot access /var/log/ovirt-engine/engine.log.*: No such file or directory ls: cannot access /var/log/ovirt-engine/server.log.*: No such file or directory ls: cannot access /var/log/ovirt-engine/jasperserver.log.*: No such file or directory ls: cannot access /var/log/ovirt-engine/engine.log.*.gz: No such file or directory ls: cannot access /var/log/ovirt-engine/engine.log.*.xz: No such file or directory ls: cannot access /var/log/ovirt-engine/server.log.*.gz: No such file or directory ls: cannot access /var/log/ovirt-engine/server.log.*.xz: No such file or directory ls: cannot access /var/log/ovirt-engine/jasperserver.log.*.gz: No such file or directory ls: cannot access /var/log/ovirt-engine/jasperserver.log.*.xz: No such file or directory 3.2 has been released 3.2 has been released |