From ed0945248a8d6d98dbb889dc7514494e1b374739 Mon Sep 17 00:00:00 2001 From: Christopher Roy Bratusek Date: Sun, 5 May 2019 20:28:24 +0200 Subject: [PATCH] logscleaner init.d script: verbose logging --- Full/system/etc/init.d/logscleaner | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/Full/system/etc/init.d/logscleaner b/Full/system/etc/init.d/logscleaner index beab334..ecd4315 100755 --- a/Full/system/etc/init.d/logscleaner +++ b/Full/system/etc/init.d/logscleaner @@ -1,30 +1,34 @@ #!/system/bin/sh echo "logscleaner init script" -echo "Starting Automatic Cleaning $(date +"%m-%d-%Y %H:%M:%S")" +echo "Starting Automatic Cleaning at $(date +"%m-%d-%Y %H:%M:%S")" # remove files older than a week to prevent pollution # filemask: * for logpath in /data/log /data/slog /data/tombstones \ /data/system/usagestats/0; do - find ${logpath} -mtime +8 -type f -exec rm -f {} \; + find ${logpath} -mtime +8 -type f -print \ + -exec rm -f {} \; 2>/dev/null done # filemask: *.tmp for logpath in /data/data/*/*/* /data/data/*/*/*/* \ /data/backup/pending/; do - find ${logpath} -mtime +8 -type f -name '*.tmp' -exec rm -f {} \; + find ${logpath} -mtime +8 -type f -name '*.tmp' \ + -print -exec rm -f {} \; 2>/dev/null done # filemask: *.apk for logpath in /data/local/ /data/local/tmp; do - find ${logpath} -mtime +8 -type f -name '*.apk' -exec rm -f {} \; + find ${logpath} -mtime +8 -type f -name '*.apk' \ + -print -exec rm -f {} \; 2>/dev/null done # filemask: *.* for logpath in /cache /cache/recovery /data/system/dropbox; do - find ${logpath} -mtime +8 -type f -name '*.*' -exec rm -f {} \; + find ${logpath} -mtime +8 -type f -name '*.*' \ + -print -exec rm -f {} \; 2>/dev/null done echo "Automatic Cleaning finished at $(date +"%m-%d-%Y %H:%M:%S")"