2
0
mirror of https://gitlab.com/Nanolx/NanoDroid synced 2024-11-07 15:20:36 +00:00

logcat init.d script: fix

This commit is contained in:
Christopher Roy Bratusek 2019-05-05 21:40:07 +02:00
parent 358ba0c6f9
commit e31d816af5
3 changed files with 3 additions and 15 deletions

View File

@ -28,7 +28,6 @@
* verbose logging * verbose logging
* logcat init.d Script * logcat init.d Script
* move logs from `/data/adb/logcat` to `/data/media/0/logcats`
* verbose logging of the script itself * verbose logging of the script itself
* simplify code * simplify code

View File

@ -3,18 +3,7 @@
# wait until boot completed # wait until boot completed
until [ `getprop sys.boot_completed`. = 1. ]; do sleep 1; done until [ `getprop sys.boot_completed`. = 1. ]; do sleep 1; done
# select storage path LOGDIR="/data/adb/logcats"
if [ -n ${EXTERNAL_STORAGE} ]; then
LOGDIR="${EXTERNAL_STORAGE}/logcats"
else
if [ -w /sdcard ]; then
LOGDIR="/sdcard/logcats"
elif [ -w /storage/self/primary ]; then
LOGDIR="/storage/self/primary/logcats"
elif [ -w /data/media/0 ]; then
LOGDIR="/data/media/0/logcats"
fi
fi
echo "logcat init script" echo "logcat init script"
echo "Starting Automatic Cleaning at $(date +"%m-%d-%Y %H:%M:%S")" echo "Starting Automatic Cleaning at $(date +"%m-%d-%Y %H:%M:%S")"
@ -22,7 +11,7 @@ echo "Starting Automatic Cleaning at $(date +"%m-%d-%Y %H:%M:%S")"
[[ ! -d ${LOGDIR} ]] && mkdir -p ${LOGDIR} [[ ! -d ${LOGDIR} ]] && mkdir -p ${LOGDIR}
# remove files older than a week to prevent pollution # remove files older than a week to prevent pollution
find /data/adb/logcat/ -print -mtime +8 -exec rm -f {} \; 2>/dev/null find ${LOGDIR} -print -mtime +8 -exec rm -f {} \; 2>/dev/null
echo "Automatic Cleaning finished at $(date +"%m-%d-%Y %H:%M:%S")" echo "Automatic Cleaning finished at $(date +"%m-%d-%Y %H:%M:%S")"

View File

@ -405,7 +405,7 @@ The following init scripts are bundled with NanoDroid
* fstrim * fstrim
* trim file systems (may increase speed) * trim file systems (may increase speed)
* logcat * logcat
* store logcat in /data/media/0/logcats * store logcat in /data/adb/logcats
* logs older than 7 days are deleted on every reboot * logs older than 7 days are deleted on every reboot
* logscleaner * logscleaner
* clean up system log files older than 7 days * clean up system log files older than 7 days