From cd96c3c3e8e1703b4e43fcbdaf9608dacf038cfc Mon Sep 17 00:00:00 2001 From: 97b69f63-601b-4697-90db-7cdf2e2a0ea5 <--unset> Date: Tue, 31 Jan 2023 22:56:10 +0100 Subject: [PATCH] Added more helpfull output to the huge file failue in the syncFromDisk function, and an example command to flush the systemd journal --- README.md | 6 ++++++ log2ram | 1 + 2 files changed, 7 insertions(+) diff --git a/README.md b/README.md index ca3249e..d89f156 100644 --- a/README.md +++ b/README.md @@ -129,6 +129,12 @@ If the `/var/log/journal` is very large, then there are a lot of system logs. De SystemMaxUse=20M ``` +**Or** the more radical version of directly flushing the journal to a size that matches log2ram size imediately _(Be aware that this flish flush the systemd journal logs imediately to the given size!)_ + +```bash +journalctl --vacuum-size=32M +``` + This should be set to a value smaller than the size of the RAM volume; for example, half of it could be fine. Then, apply the new setting: ```bash diff --git a/log2ram b/log2ram index c548ece..a151a42 100755 --- a/log2ram +++ b/log2ram @@ -63,6 +63,7 @@ sync_from_disk() { if [ -n "$(du -sh -t "$TP_SIZE" "$HDD_LOG"/ | cut -f1)" ]; then echo "ERROR: RAM disk for \"$HDD_LOG/\" too small. Can't sync." + echo -e "File(s) causing issues\n: $(du -sh -t "$TP_SIZE" "$HDD_LOG"/*)" umount -l "$RAM_LOG"/ umount -l "$HDD_LOG"/ if [ "$MAIL" = true ]; then