add postrotate to ramlog

Improve armbian-ramlog. See discussion here :
https://github.com/armbian/build/issues/1582
This commit is contained in:
Averell7 2019-10-07 19:29:17 +02:00 committed by GitHub
parent b6706ec67a
commit 62e6febab8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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