mirror of
https://gitlab.com/Nanolx/NanoDroid
synced 2024-11-07 15:20:36 +00:00
logsclaner init.d script: only remove files older than 7 days
This commit is contained in:
parent
7879095691
commit
0d47b0fd50
@ -2,19 +2,29 @@
|
|||||||
|
|
||||||
echo "logscleaner init script"
|
echo "logscleaner init script"
|
||||||
echo "Starting Automatic Cleaning $(date +"%m-%d-%Y %H:%M:%S")"
|
echo "Starting Automatic Cleaning $(date +"%m-%d-%Y %H:%M:%S")"
|
||||||
rm -f /data/data/*/*/*/*.tmp
|
|
||||||
rm -f /data/data/*/*/*/*/*.tmp
|
# remove files older than a week to prevent pollution
|
||||||
rm -f /data/local/*.apk
|
|
||||||
rm -f /data/local/tmp/*.apk
|
# filemask: *
|
||||||
rm -f /data/log/*
|
for logpath in /data/log /data/slog /data/tombstones \
|
||||||
rm -f /data/slog/*
|
/data/system/usagestats/0; do
|
||||||
rm -f /cache/*.*
|
find ${logpath} -mtime +8 -type f -exec rm -f {} \;
|
||||||
rm -f /cache/recovery/*.*
|
done
|
||||||
rm -f /data/system/dropbox/*.*
|
|
||||||
rm -f /data/backup/pending/*.tmp
|
# filemask: *.tmp
|
||||||
rm -f /data/tombstones/*
|
for logpath in /data/data/*/*/* /data/data/*/*/*/* \
|
||||||
rm -f /data/system/usagestats/0/daily/*
|
/data/backup/pending/; do
|
||||||
rm -f /data/system/usagestats/0/monthly/*
|
find ${logpath} -mtime +8 -type f -name '*.tmp' -exec rm -f {} \;
|
||||||
rm -f /data/system/usagestats/0/weekly/*
|
done
|
||||||
rm -f /data/system/usagestats/0/yearly/*
|
|
||||||
|
# filemask: *.apk
|
||||||
|
for logpath in /data/local/ /data/local/tmp; do
|
||||||
|
find ${logpath} -mtime +8 -type f -name '*.apk' -exec rm -f {} \;
|
||||||
|
done
|
||||||
|
|
||||||
|
# filemask: *.*
|
||||||
|
for logpath in /cache /cache/recovery /data/system/dropbox; do
|
||||||
|
find ${logpath} -mtime +8 -type f -name '*.apk' -exec rm -f {} \;
|
||||||
|
done
|
||||||
|
|
||||||
echo "Automatic Cleaning finished at $(date +"%m-%d-%Y %H:%M:%S")"
|
echo "Automatic Cleaning finished at $(date +"%m-%d-%Y %H:%M:%S")"
|
||||||
|
Loading…
Reference in New Issue
Block a user