-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Adds logrotation #1140
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
Adds logrotation #1140
Conversation
b0845eb
to
2966700
Compare
Hm, when running the buildx script locally on the current dev branch it runs into the same error as the pipeline, so i think this has nothing to do with my changes, though it does seem suspicios as the line with my changes seems to cause the error |
2966700
to
289d179
Compare
This is an automated message from CI: Docker Image for build 3 is available on DockerHub as Note: ensure you backup your NPM instance before testing this PR image! Especially if this PR contains database changes. |
This is an automated message from CI: Docker Image for build 4 is available on DockerHub as Note: ensure you backup your NPM instance before testing this PR image! Especially if this PR contains database changes. |
So when/how does the logrotate binary run? |
Logrotate should automatically add itself as a daily cronjob but only rotate the logs weekly as per the config. |
So the problem with that is that there is no cron daemon running in the container so nothing will happen. You can either add crond and start it in the same way as the nginx service or have the nodejs backend run the log rotate binary in a similar way to how it runs certbot periodically. |
Ah, I assumed certbot was running via cron as well, not manually, but makes sense. |
63e64d7
to
b7b150a
Compare
This is an automated message from CI: Docker Image for build 6 is available on DockerHub as Note: ensure you backup your NPM instance before testing this PR image! Especially if this PR contains database changes. |
nginx cannot create the folder structure for logs
This is an automated message from CI: Docker Image for build 7 is available on DockerHub as Note: ensure you backup your NPM instance before testing this PR image! Especially if this PR contains database changes. |
I finally got around to changing it. I'm now running it on my production server for a while, to verify it working. |
This is an automated message from CI: Docker Image for build 8 is available on DockerHub as Note: ensure you backup your NPM instance before testing this PR image! Especially if this PR contains database changes. |
I have now hat it running on my personal production server for a while, and I think it is ready to be merged. |
This PR adds logrotation to the access and error logs of the hosts. both are rotated weekly. For access logs the last 4 files (=4 weeks) are kept, for error logs the last 10 files are kept.
Running performing the dry-run with
seems to work as expected, however we will have to wait to see if it actually does everything as expected.
Fixes #183.