SignalK Compress N2K Logfiles

My SignalK is quite nicely creating log files every hour in the .signalk directory. Is there a way that I can get SignalK to gzip these files when it is done? I was thinking about a cron job to gzip anything ending in *.log that has a minage of 120mins if not - is that the simplest approach? Thanks
5 Replies
Scott Bender
Scott Bender6d ago
It would be cool to have the server do that automatically. But not there. Your approach makes sense.
HansT
HansT6d ago
That's better to leave to logrotate, I'd say: https://www.linuxtechi.com/manage-linux-log-files-using-logrotate/
Scott Bender
Scott Bender6d ago
Yes
UncleBulgaria
UncleBulgariaOP6d ago
Why? There's nothing to "rotate" the logs are already created and timestamped hourly by SignalK so every hour already has it's own file... I just want them to be compressed
Scott Bender
Scott Bender5d ago
I wonder if it can just handle the compression

Did you find this page helpful?