logcat init.d script: fix

merge-requests/23/head
Christopher Roy Bratusek 5 years ago
parent 358ba0c6f9
commit e31d816af5

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

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

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

Loading…
Cancel
Save