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

Add gromox-cleanup.sh script #111

Open
wants to merge 5 commits into
base: prime
Choose a base branch
from

Conversation

deajan
Copy link

@deajan deajan commented Nov 25, 2024

Purpose of this PR: Keep gromox folders clean

While playing with gromox, I wrote a prometheus exporter here after which I noticed that some mailboxes were quite huge, even when the ondisk maidir was twice as small.

Discussing with @WalterHof and @crpb, they suggested to run various cleanups.
I was wondering why that wasn't "standard" for Grommunio, so here's a script that perhaps should be added by default to Grommunio's setup via a systemd timer / or even as fs-hook/thaw for VM environments.

Currently tested on two Grommunio servers running gromox 2.37.

Thanks for considering this.

@WalterHof
Copy link
Member

Do not write to a log file (/var/log/${SCRIPT_NAME}.log). Write to systemd logging instead,

@crpb
Copy link
Contributor

crpb commented Nov 25, 2024

Write to systemd logging instead,

ahh right. and with the .service you can just echo you to stdout and it will show up in the journal under --unit grommunio-cleanup or however it might be called in the end.
And for different levels logger/systemd-cat -p err/info/...

@deajan
Copy link
Author

deajan commented Nov 25, 2024

Pull request updated as per your suggestions. New script has been tested again.
@crpb Note that I have changed the timer to make it run everyday at 2am.

There's just one thing, I don't know where @jengelh would place the script, so I cannot convert the systemd unit file to a template file.

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

Successfully merging this pull request may close these issues.

3 participants