On Fri, Feb 23, 2018 at 09:40:37AM -0700, Brad Grissom wrote: > Hi I'd like to re-run my xz compression processor on .u files, maybe during > the next rotation. My problem is that I'm running an embedded Linux system > and it gets unplugged all the time, so I end up with .u log files that are > uncompressed by the s6-log processor. > > I am using this to log: > > s6-log -b n30 s5242880 S15728640 !xz /appdata > > This is an issue because I have limited flash storage space and would love > to be able to store as many (compressed) logs as possible. I figure I must > be missing something because this is probably a common occurrence for many > people. > > If anybody has any ideas, I would love to hear it! Thanks! Lots of ways to fix this. If you have a cron-alike, an @reboot trigger can do it: @reboot sleep SOMEPERIOD find /path/to/dirs -name '*.u' -exec xz "{}" \;
If you don't mind polling, something similar but as an s6 service works, though you can use s6-pause from s6-portable-utils to stop it from refiring (and as such no longer polling). If you don't have that, a finish script that puts the service down works, but that's kinda ugly. > > ~~Brad Grissom Cheers! -- Colin Booth