From 62e6febab88627cbedfc7b84fb0fd80e56bdc94a Mon Sep 17 00:00:00 2001 From: Averell7 Date: Mon, 7 Oct 2019 19:29:17 +0200 Subject: [PATCH] add postrotate to ramlog Improve armbian-ramlog. See discussion here : https://github.com/armbian/build/issues/1582 --- packages/bsp/common/usr/lib/armbian/armbian-ramlog | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/packages/bsp/common/usr/lib/armbian/armbian-ramlog b/packages/bsp/common/usr/lib/armbian/armbian-ramlog index 6bdb986243..27e98603cc 100755 --- a/packages/bsp/common/usr/lib/armbian/armbian-ramlog +++ b/packages/bsp/common/usr/lib/armbian/armbian-ramlog @@ -112,6 +112,14 @@ case "$1" in write) syncToDisk ;; + postrotate) + cd /var/log.hdd/ + find . -type f -print | grep -E -v "(\.gz|\.xz|\.[0-9]|armbian-ramlog)" | while IFS= read -r file + do + dest="/var/log/$file" + cat $file > $dest + done + ;; *) echo "Usage: ${0##*/} {start|stop|write}" >&2 exit 1