Skip to content
New issue

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

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cronjob to rotate file should be smarter #12

Open
Zugschlus opened this issue Nov 17, 2017 · 3 comments
Open

cronjob to rotate file should be smarter #12

Zugschlus opened this issue Nov 17, 2017 · 3 comments

Comments

@Zugschlus
Copy link
Contributor

Hi,

this is me forwarding https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=848708

When using "atop" on a machine that's not running 24/7, the cronjob at
00:00 is not run more often than not (depending on your usage pattern, of
course ;). This makes some use of "atop" harder than necessary; "atop -r y"
doesn't work, you'll need the right amount of "y"esterdays to find the
right file.

So, either

  1. the cronjob could be smarter, to check whether the date has
    changed (and then would need to run every minute?),
  2. or "atop" could be handling that (just open the file for every write,
    ie. by default every 600 seconds, with the correct path newly calculated),
  3. or things like suspend/resume could signal atop to start a new file.

I guess option 2 would be the easiest one to implement, and the most likely
to be correct.

Thank you for your consideration!

(thanks to Ph Marek for filing this)

@Zugschlus
Copy link
Contributor Author

Would this be addressed as well with the changes in atop 2.7.0?

@Atoptool
Copy link
Owner

I guess this issue is already solved by earlier modifications, using a systems timer instead of cron.
The atop-rotate.timer takes care that atop-rotate.service is started at midnight (OnCalendar=daily) for systems that run 24/7. The atop-rotate.service restarts the atop.service, terminating the current atop running in the background and starting a new atop creating a new daily file with the actual date.
For system that are not running 24/7 atop.service is activated during boot. Also in that case atop creates a new daily file with the actual date.

@Zugschlus
Copy link
Contributor Author

Thanks for pulling this back to my attention. I have reached out to the original bug reporter, asking them whether the issue is still present in current atop. I will close the Debian bug according to their answer or by the end of July 2022, whatever happens first. Feel free to close this here earlier, but maybe it would be wise to close both reports simultaneously.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants