Advertisement
v1ral_ITS

timer_cpu.sh

Mar 30th, 2019
180
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.97 KB | None | 0 0
  1. #!/system/bin/sh
  2. sleep 120
  3. busybox ls -i -l -R /system > /cache/logs/logcat/hotfile.system.txt
  4. busybox ls -i -l -R /data > /cache/logs/logcat/hotfile.data.txt
  5. top -m 8 -d 180 -t >> /cache/logs/logcat/cpu.txt&
  6. while true
  7. do
  8. sleep 180
  9. #busybox top -d 60 -n 10 1>>/cache/logs/logcat/cpu.txt
  10. #cat /proc/msm_pm_stats >>$logfile
  11. l=`busybox du -s  /cache/logs//logcat/trace.0 | busybox awk '{print $1}'`
  12. if busybox [ "$l" -gt "4096" ] ;then
  13.     busybox rm -fr /cache/logs/logcat/trace.5.tar.gz
  14.     busybox mv /cache/logs/logcat/trace.4.gz /cache/logs/logcat/trace.5.gz
  15.     busybox mv /cache/logs/logcat/trace.3.gz /cache/logs/logcat/trace.4.gz
  16.     busybox mv /cache/logs/logcat/trace.2.gz /cache/logs/logcat/trace.3.gz
  17.     busybox mv /cache/logs/logcat/trace.1.gz /cache/logs/logcat/trace.2.gz
  18.     cd /cache/logs/logcat/
  19.     busybox tar zcf /cache/logs/logcat/trace.1.gz trace.0
  20.     echo "" > /cache/logs/logcat/trace.0
  21.     sync
  22. fi
  23. date >> /cache/logs/logcat/cpu.txt
  24. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement