Séra Balázs@lemmy.world to linuxmemes@lemmy.world · 3 months agoRemember to not to forget clearing your journallemmy.worldimagemessage-square60fedilinkarrow-up1586arrow-down19
arrow-up1577arrow-down1imageRemember to not to forget clearing your journallemmy.worldSéra Balázs@lemmy.world to linuxmemes@lemmy.world · 3 months agomessage-square60fedilink
minus-squarePacmanlives@lemmy.worldlinkfedilinkarrow-up2·3 months agoActually something I never dug into. But does logrotate no longer work? I have a bunch of disk space these days so I would not notice large log files
minus-squareMorethanevil@lemmy.fedifriends.sociallinkfedilinkarrow-up2·edit-23 months agoIf logrotate doesn’t work, than use this as a cronjob via sudo crontab -e Put this line at the end of the file: 0 0 * * * journalctl --vacuum-size=1G >/dev/null 2>&1 Everyday the logs will be trimmed to 1GB. Usually the logs are trimmed automatically at 4GB, but sometimes this does not work
minus-squarefallingcats@discuss.tchncs.delinkfedilinkarrow-up5·3 months agoIf we’re using systemd already, why not a timer?
minus-squareMorethanevil@lemmy.fedifriends.sociallinkfedilinkarrow-up3·3 months agoCron is better known than a systemd timer, but you can provide an example for the timer 😃
minus-squarefallingcats@discuss.tchncs.delinkfedilinkarrow-up5·edit-23 months agoReally, the correct way would be to set the limit you want for journald. Put this into /etc/systemd/journald.conf.d/00-journal-size.conf: [Journal] SystemMaxUse=50M Or something like this using a timer: systemd-run --timer-property=OnCalender=daily $COMMAND
minus-squareMorethanevil@lemmy.fedifriends.sociallinkfedilinkarrow-up2·3 months agoThanks for this addition ☺️
Actually something I never dug into. But does logrotate no longer work? I have a bunch of disk space these days so I would not notice large log files
If logrotate doesn’t work, than use this as a cronjob via
sudo crontab -e
Put this line at the end of the file:0 0 * * * journalctl --vacuum-size=1G >/dev/null 2>&1
Everyday the logs will be trimmed to 1GB. Usually the logs are trimmed automatically at 4GB, but sometimes this does not work
If we’re using systemd already, why not a timer?
Cron is better known than a systemd timer, but you can provide an example for the timer 😃
Really, the correct way would be to set the limit you want for journald. Put this into
/etc/systemd/journald.conf.d/00-journal-size.conf
:Or something like this using a timer:
systemd-run --timer-property=OnCalender=daily $COMMAND
Thanks for this addition ☺️