init scripts: unify time format (24h)

merge-requests/23/head
Christopher Roy Bratusek 5 years ago
parent e31d816af5
commit 7e19cbd4d8

@ -22,6 +22,8 @@
* move init.d scripts logs from `${MODDIR}/.logs` to `${MODDIR}/logs`
* make all init.d scripts wait until device fully booted (sys.boot_completed)
* only effects System Mode, already been the case for Magisk Mode before
* change and unify time format to 24h clock for logging to "+%Y%m%d-%H.%M.%S"
* example: 20190505-09.35.00, 20190505-21.35.00
* logscleaner init.d Script
* only clean files older than 7 days

@ -12,7 +12,7 @@ LOGDIR="${MODDIR}"/logs
until [ `getprop sys.boot_completed`. = 1. ]; do sleep 1; done
# Set current date in 20170607-12.07.25 format
CURDATE=$(date +%Y%m%d-%I.%M.%S)
CURDATE=$(date +%Y%m%d-%H.%M.%S)
# This script will be executed in late_start service mode
# More info in the main Magisk thread

@ -6,17 +6,17 @@ until [ `getprop sys.boot_completed`. = 1. ]; do sleep 1; done
LOGDIR="/data/adb/logcats"
echo "logcat init script"
echo "Starting Automatic Cleaning at $(date +"%m-%d-%Y %H:%M:%S")"
echo "Starting Automatic Cleaning at $(date +%Y%m%d-%H.%M.%S)"
[[ ! -d ${LOGDIR} ]] && mkdir -p ${LOGDIR}
# remove files older than a week to prevent pollution
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 +%Y%m%d-%H.%M.%S)"
# Set current date in 20170607-12.07.25 format
CURDATE=$(date +%Y%m%d-%I.%M.%S)
CURDATE=$(date +%Y%m%d-%H.%M.%S)
echo "Recording logcat to: ${LOGDIR}/${CURDATE}"

@ -4,7 +4,7 @@
until [ `getprop sys.boot_completed`. = 1. ]; do sleep 1; done
echo "logscleaner init script"
echo "Starting Automatic Cleaning at $(date +"%m-%d-%Y %H:%M:%S")"
echo "Starting Automatic Cleaning at $(date +%Y%m%d-%H.%M.%S)"
# remove files older than a week to prevent pollution
@ -34,4 +34,4 @@ for logpath in /cache /cache/recovery /data/system/dropbox; do
-print -exec rm -f {} \; 2>/dev/null
done
echo "Automatic Cleaning finished at $(date +"%m-%d-%Y %H:%M:%S")"
echo "Automatic Cleaning finished at $(date +%Y%m%d-%H.%M.%S)"

@ -6,7 +6,7 @@ until [ `getprop sys.boot_completed`. = 1. ]; do sleep 1; done
echo "sqlite init script"
if which sqlite3 >/dev/null; then
echo "SQLite database VACUUM and REINDEX started at $(date +"%m-%d-%Y %H:%M:%S")"
echo "SQLite database VACUUM and REINDEX started at $(date +%Y%m%d-%H.%M.%S)"
for i in `find /data/* -iname "*.db"`; do
sqlite3 $i 'VACUUM;'
resVac=$?
@ -26,6 +26,6 @@ if which sqlite3 >/dev/null; then
echo "Database $i: VACUUM=$resVac REINDEX=$resIndex"
done
echo "SQLite database VACUUM and REINDEX finished at $(date +"%m-%d-%Y %H:%M:%S")"
echo "SQLite database VACUUM and REINDEX finished at $(date +%Y%m%d-%H.%M.%S)"
else echo "sqlite3 not installed, stop"
fi

Loading…
Cancel
Save