Just noticed my weechat logs are getting quite big, and figured I should gzip them to save space, but then thought maybe we can have weechat write to the files gzipped?
But is this even possible? By the nature of compression, I have a feeling it would not be, unless output is buffered and written in chunks... but I have no idea how gzip actually works :(
and on that note, maybe there is a better lib/algorithm for compressing a text stream?
Please & Thanks :)
If it isn't possible to gzip current logs, maybe just gzipping old ones would be fine. If you have logs set to rotate by day, week or month. When a new log file is made it can gzip the old ones.
It should keep more than one ungzipped log file per buffer though, especially if logs are rotated by day. Maybe it could be a configuration option.
Maybe just have weechat read the compressed log files using: zcat like other applications do.
Using LOGROTATE(8) would simply handle this job. Logrotate is run as a daily cron job, and a user can set it up however they like.
With ~500 MB of log data, I am interested in this possibility but would be concerned about losing the convenience of readily-available, universally viewable logs.
Sent from my Android device with K-9 Mail. Please excuse my brevity.
I have 2.0 GB worth of logs that're causing me some space issues right now, but I can't sacrifice the ability to easily search through them with /grep or similar plugins. Having weechat automatically compress these in a way that can be read via weechat would be superb, so this gets my 馃憤.
In the meantime, a fork of the grep plugin could likely be made to consider rotated, compressed files in its searching. That requires not only a custom plugin, but also a cron/systemd job for logrotating.
Most helpful comment
I have 2.0 GB worth of logs that're causing me some space issues right now, but I can't sacrifice the ability to easily search through them with
/grepor similar plugins. Having weechat automatically compress these in a way that can be read via weechat would be superb, so this gets my 馃憤.In the meantime, a fork of the
grepplugin could likely be made to consider rotated, compressed files in its searching. That requires not only a custom plugin, but also a cron/systemd job for logrotating.