mirror of
https://github.com/gtxaspec/wz_mini_hacks.git
synced 2025-06-30 00:19:48 +00:00
add function to delete logs older than 5 boots
This commit is contained in:
parent
9138ba4a9c
commit
35d106a5c5
@ -162,6 +162,15 @@ dmesg > $DMESG_LOG.log 2>&1
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
trim_logs() {
|
||||||
|
|
||||||
|
echo "Deleting logs older than 5 boots..."
|
||||||
|
|
||||||
|
find /opt/wz_mini/log -name '*log*' | while read file; do
|
||||||
|
[ "${file#/opt/wz_mini/log/*log.}" -gt 5 ] && rm -v "$file"
|
||||||
|
done
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
first_run_check
|
first_run_check
|
||||||
wait_sdroot
|
wait_sdroot
|
||||||
@ -559,6 +568,7 @@ touch /opt/wz_mini/tmp/.wz_user_firstrun
|
|||||||
pkill -f dumpload #Kill dumpload so it won't waste cpu or ram gathering cores when something crashes
|
pkill -f dumpload #Kill dumpload so it won't waste cpu or ram gathering cores when something crashes
|
||||||
sysctl -w kernel.core_pattern='|/bin/false'
|
sysctl -w kernel.core_pattern='|/bin/false'
|
||||||
dmesg_log
|
dmesg_log
|
||||||
|
trim_logs
|
||||||
sync;echo 3 > /proc/sys/vm/drop_caches
|
sync;echo 3 > /proc/sys/vm/drop_caches
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user