Add support for hourly logrotate #1043

Merged
merged 2 commits into from Jun 9, 2016

Conversation

Projects
None yet
5 participants
@tpetr
Member

tpetr commented May 18, 2016

Needed for verbose tasks where daily log rotation isn't often enough.

@tpetr tpetr added the hs_staging label May 18, 2016

+package com.hubspot.singularity.executor;
+
+public enum SingularityExecutorLogrotateFrequency {
+ HOURLY("monthly"),

This comment has been minimized.

@ssalinas

ssalinas May 18, 2016

Member

meant hourly here?

@ssalinas

ssalinas May 18, 2016

Member

meant hourly here?

This comment has been minimized.

@tpetr

tpetr May 18, 2016

Member

meant to add a comment here -- hourly isn't supported by all versions of logrotate. my intent was to make it run as infrequently as possible (hence monthly) and then manually trigger logrotate by the executor. (open to other options if you have other ideas here)

@tpetr

tpetr May 18, 2016

Member

meant to add a comment here -- hourly isn't supported by all versions of logrotate. my intent was to make it run as infrequently as possible (hence monthly) and then manually trigger logrotate by the executor. (open to other options if you have other ideas here)

This comment has been minimized.

@ssalinas

ssalinas May 18, 2016

Member

Right, forgot it doesn't actually have an hourly setting. Would it make sense to instead write something to /etc/cron.hourly/? Value probably doesn't matter in either case since it's manually triggered. Then we could let cron do it's thing rather than having the executor worry about it. Just a thought, this way would work too.

@ssalinas

ssalinas May 18, 2016

Member

Right, forgot it doesn't actually have an hourly setting. Would it make sense to instead write something to /etc/cron.hourly/? Value probably doesn't matter in either case since it's manually triggered. Then we could let cron do it's thing rather than having the executor worry about it. Just a thought, this way would work too.

This comment has been minimized.

@wsorenson

wsorenson May 18, 2016

Member

wouldn't it be far simpler if we made this functionality only work with versons of logrotate which support hourly?

@wsorenson

wsorenson May 18, 2016

Member

wouldn't it be far simpler if we made this functionality only work with versons of logrotate which support hourly?

This comment has been minimized.

@ssalinas

ssalinas May 18, 2016

Member

Should have clarified that comment, logrotate straight up doesn't support hourly (as far as I know). Most places suggest setting things up in cron.hourly or running a command/script manually if you need to rotate more than daily. From man pages:

       Normally, logrotate is run as a daily cron job.  It will not  modify  a
       log  multiple  times  in  one  day unless the criterium for that log is
       based on the log’s size and logrotate is being run multiple times  each
       day, or unless the -f or -force option is used.
@ssalinas

ssalinas May 18, 2016

Member

Should have clarified that comment, logrotate straight up doesn't support hourly (as far as I know). Most places suggest setting things up in cron.hourly or running a command/script manually if you need to rotate more than daily. From man pages:

       Normally, logrotate is run as a daily cron job.  It will not  modify  a
       log  multiple  times  in  one  day unless the criterium for that log is
       based on the log’s size and logrotate is being run multiple times  each
       day, or unless the -f or -force option is used.

This comment has been minimized.

@tpetr

tpetr May 18, 2016

Member

The more I think about it, the more I think it'd be OK to go down the /etc/cron.hourly/ route. I'll update the PR.

@tpetr

tpetr May 18, 2016

Member

The more I think about it, the more I think it'd be OK to go down the /etc/cron.hourly/ route. I'll update the PR.

This comment has been minimized.

@solomonty

solomonty May 30, 2016

The puppet-logrotate module and newer versions of logrotate support hourly rotation.

We sometimes need to rotate more often than hourly and we create a manual entry in /etc/cron.d with the appropriate schedule and use the -f option.

@solomonty

solomonty May 30, 2016

The puppet-logrotate module and newer versions of logrotate support hourly rotation.

We sometimes need to rotate more often than hourly and we create a manual entry in /etc/cron.d with the appropriate schedule and use the -f option.

@ssalinas ssalinas modified the milestone: 0.8.0 May 19, 2016

@tpetr

This comment has been minimized.

Show comment
Hide comment
@tpetr

tpetr May 19, 2016

Member

Updated PR use cron for hourly logrotate, confirmed working in the test cluster.

Member

tpetr commented May 19, 2016

Updated PR use cron for hourly logrotate, confirmed working in the test cluster.

@tpetr tpetr added the hs_qa label May 19, 2016

@tpetr tpetr added the hs_stable label May 20, 2016

@gchomatas

This comment has been minimized.

Show comment
Hide comment
@gchomatas

gchomatas May 23, 2016

Contributor

🚢

Contributor

gchomatas commented on d56979c May 23, 2016

🚢

@tpetr tpetr added hs_qa hs_stable and removed hs_qa hs_stable labels Jun 9, 2016

@tpetr tpetr merged commit 0478f3b into master Jun 9, 2016

0 of 2 checks passed

continuous-integration/travis-ci/push The Travis CI build could not complete due to an error
Details
continuous-integration/travis-ci/pr The Travis CI build is in progress
Details

@ssalinas ssalinas deleted the logrotate-interval branch Sep 12, 2016

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