Add gzip support to log module #424

Open
opened 2026-10-05 04:20:04 +02:00 by adam · 4 comments
Owner

Would it be possible to add gzip archiving support to the log module? Basically, the desired functionality would be to have the logs automatically gzip'd on start or on date change. (When ZNC starts, the log module can check for non-gzip'd logs, and archive them accordingly.)

Users' logs take up a lot of space (gigabytes for some), and while cronjobs might not hurt, it wouldn't be a bad idea to have automatic gziping in place.

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/6964225-add-gzip-support-to-log-module?utm_campaign=plugin&utm_content=tracker%2F1759&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F1759&utm_medium=issues&utm_source=github).
Would it be possible to add gzip archiving support to the log module? Basically, the desired functionality would be to have the logs automatically gzip'd on start or on date change. (When ZNC starts, the log module can check for non-gzip'd logs, and archive them accordingly.) Users' logs take up a lot of space (gigabytes for some), and while cronjobs might not hurt, it wouldn't be a bad idea to have automatic gziping in place. ## <bountysource-plugin> --- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/6964225-add-gzip-support-to-log-module?utm_campaign=plugin&utm_content=tracker%2F1759&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F1759&utm_medium=issues&utm_source=github). </bountysource-plugin> <!-- github-sync-id:51779218 -->
Author
Owner

10/10 would love this - but IRC has been slowing down recently (same with ZNC). If I get a chance, I might add it myself :)

10/10 would love this - but IRC has been slowing down recently (same with ZNC). If I get a chance, I might add it myself :) <!-- github-comment-id:316883146 -->
Author
Owner

+1, I'm really interested in this! Thanks for the suggestion

+1, I'm really interested in this! Thanks for the suggestion <!-- github-comment-id:355563978 -->
Author
Owner

I run the cronjob /usr/bin/find /var/lib/znc/.znc/users -mtime +1 -type f -name *.log -exec /usr/bin/gzip {} \; once a night to compress logs.

I run the cronjob `/usr/bin/find /var/lib/znc/.znc/users -mtime +1 -type f -name *.log -exec /usr/bin/gzip {} \;` once a night to compress logs. <!-- github-comment-id:366213259 -->
Author
Owner

I like --name --best --rsyncable combination of gzip flags:

echo "# Run daily and gzip >1 day old logs that are not yet gziped
0 1 * * * znc /usr/bin/find /var/lib/znc/moddata/log/ -mtime +1 -type f -name '*.log' -exec /bin/gzip --name --best --rsyncable {} \;

" > /etc/cron.d/znc-gzip-logs

Correct for the log dir location and znc user name.

I like `--name --best --rsyncable` combination of gzip flags: ```sh echo "# Run daily and gzip >1 day old logs that are not yet gziped 0 1 * * * znc /usr/bin/find /var/lib/znc/moddata/log/ -mtime +1 -type f -name '*.log' -exec /bin/gzip --name --best --rsyncable {} \; " > /etc/cron.d/znc-gzip-logs ``` Correct for the log dir location and znc user name. <!-- github-comment-id:388602925 -->
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adam/znc#424