gather_wz_logs.sh 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. #!/bin/sh
  2. create_dir() {
  3. echo "creating gather dir"
  4. mkdir /opt/wz_mini/tmp/log_gather
  5. }
  6. if [ -d /opt/wz_mini/tmp/log_gather ] ; then
  7. echo "gather dir already present, deleting."
  8. rm -rf /opt/wz_mini/tmp/log_gather
  9. create_dir
  10. else
  11. create_dir
  12. fi
  13. #cat * | grep 2C | sed 's/^.*\(RTSP_PASSWORD=\).*$/\1/' | sed 's/-U[^-P]*//'
  14. echo "copy wz_mini logs"
  15. cp /opt/wz_mini/log/* /opt/wz_mini/tmp/log_gather/
  16. echo "gather impdbg"
  17. impdbg --enc_info > /opt/wz_mini/tmp/log_gather/enc_info
  18. echo "gather logcat"
  19. logcat -d > /opt/wz_mini/tmp/log_gather/logcat
  20. echo "gather callback"
  21. logread | grep callback > /opt/wz_mini/tmp/log_gather/callback.log
  22. echo "gather local_sdk"
  23. logread | grep local_sdk > /opt/wz_mini/tmp/log_gather/local_sdk.log
  24. echo "gather /dev"
  25. ls -l /dev > /opt/wz_mini/tmp/log_gather/dev.log
  26. echo "gather df"
  27. df -h > /opt/wz_mini/tmp/log_gather/df.log
  28. echo "gather libcallback logs"
  29. logread | grep "\[command\]" > /opt/wz_mini/tmp/log_gather/libcallback.log
  30. echo "gather process list"
  31. ps -T | sed 's/-U[^-P]*//' > /opt/wz_mini/tmp/log_gather/ps.log
  32. echo "gather mounts"
  33. mount > /opt/wz_mini/tmp/log_gather/mount.log
  34. echo "gather mmc"
  35. logread | grep -E "mmc|storage_dev|playback_dev|tf_prepare" > /opt/wz_mini/tmp/log_gather/mmc.log
  36. echo "gather lsmod"
  37. lsmod > /opt/wz_mini/tmp/log_gather/kmod.log
  38. echo "gather app.ver"
  39. cp /system/bin/app.ver /opt/wz_mini/tmp/log_gather/system_app.ver
  40. if [ -f /tmp/sd_check_result.txt ]; then
  41. echo "copy sd_check_result.txt"
  42. cp /tmp/sd_check_result.txt /opt/wz_mini/tmp/log_gather/sd_check_result.txt
  43. fi
  44. echo "compress to /media/mmc/log_gather_$(date +"%F_T%H%M").tar.gz"
  45. tar -czf /media/mmc/log_gather_$(date +"%F_T%H%M").tar.gz -C /opt/wz_mini/tmp log_gather/
  46. echo "cleanup, remove gather dir"
  47. rm -rf /opt/wz_mini/tmp/log_gather