Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

pmlogger_daily: 'compress archive data files after N days' seems to be off by one day. #99

Closed
sikadiamond opened this Issue Jul 25, 2016 · 1 comment

Comments

Projects
None yet
2 participants

As executed on todays date:

/usr/lib/pcp/bin/pmlogger_daily -X xz -x 1
ls /var/log/pcp/pmlogger/hostname/
20160710.0.xz   20160711.meta   20160713.0.xz   20160714.index  20160715.meta   20160717.0.xz   20160718.index  20160719.meta   20160721.0.xz   20160722.index  20160723.meta   20160725.00.10.0      20160725.09.05.index  20160725.09.12.meta
20160710.index  20160712.0.xz   20160713.index  20160714.meta   20160716.0.xz   20160717.index  20160718.meta   20160720.0.xz   20160721.index  20160722.meta   20160724.0      20160725.00.10.index  20160725.09.05.meta   Latest
20160711.0.xz   20160712.index  20160713.meta   20160715.0.xz   20160716.index  20160717.meta   20160719.0.xz   20160720.index  20160721.meta   20160723.0      20160724.index  20160725.00.10.meta   20160725.09.12.0      pmlogger.log
20160711.index  20160712.meta   20160714.0.xz   20160715.index  20160716.meta   20160718.0.xz   20160719.index  20160720.meta   20160722.0.xz   20160723.index  20160724.meta   20160725.09.05.0      20160725.09.12.index  pmlogger.log.prior

20160722.0.xz is het last compressed archive...

/usr/lib/pcp/bin/pmlogger_daily -X xz -x 0
ls /var/log/pcp/pmlogger/hostname/
20160710.0.xz   20160711.meta   20160713.0.xz   20160714.index  20160715.meta   20160717.0.xz   20160718.index  20160719.meta   20160721.0.xz   20160722.index  20160723.meta   20160725.00.10.0      20160725.09.05.index  20160725.09.12.meta   Latest
20160710.index  20160712.0.xz   20160713.index  20160714.meta   20160716.0.xz   20160717.index  20160718.meta   20160720.0.xz   20160721.index  20160722.meta   20160724.0      20160725.00.10.index  20160725.09.05.meta   20160725.09.13.0      pmlogger.log
20160711.0.xz   20160712.index  20160713.meta   20160715.0.xz   20160716.index  20160717.meta   20160719.0.xz   20160720.index  20160721.meta   20160723.0.xz   20160724.index  20160725.00.10.meta   20160725.09.12.0      20160725.09.13.index  pmlogger.log.prior
20160711.index  20160712.meta   20160714.0.xz   20160715.index  20160716.meta   20160718.0.xz   20160719.index  20160720.meta   20160722.0.xz   20160723.index  20160724.meta   20160725.09.05.0      20160725.09.12.index  20160725.09.13.meta

Now 20160723.0.xz is het last compressed archive, but one would expect with 0 days to have 20160724.0 compressed as well, unless I am missing something.

Contributor

kmcdonell commented Jul 25, 2016

pmlogger_daily is really intended to be run at the same time (00:10 by default) each day from cron.

The -x (and -k and -t) options all use the modified time of the inode (not the name of the file) to determine which files to compress (or cull).

So there is considerable scope for this to be "off by one (or more)", especially for interactive invocation at a random time with respect to the scheduled cron runs.

I don't think there is a bug here and there is reasonable coverage of this functionality in the QA suite.

I'll leave it to @sikadiamond to close the issue if (s)he agrees.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment