log_clear.sh 1017 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. #!/bin/bash
  2. ###
  3. # @Descripttion:
  4. # @version:
  5. # @Author: Neo,Huang
  6. # @Date: 2022-01-10 11:54:47
  7. # @LastEditors: Neo,Huang
  8. # @LastEditTime: 2022-01-25 11:39:57
  9. ###
  10. # 绝对路径
  11. abspath=$(cd "$(dirname "$0")";pwd)
  12. source $abspath/func.sh
  13. set_global
  14. system=$(uname -s)
  15. if [ "$system" == "Linux" ] ;then
  16. platform="linux"
  17. else
  18. platform="macosx"
  19. fi
  20. logDir=`get_config logpath`
  21. echo $logDir
  22. if [ "$platform" == "macosx" ] ;then
  23. find $logDir -iname '*.log' | xargs rm -f
  24. find $logDir -iname '*.info' | xargs rm -f
  25. else
  26. find $logDir '*.log' | xargs rm -f
  27. find $logDir '*.info' | xargs rm -f
  28. fi
  29. logDir=`get_config statistic_path`
  30. echo $logDir
  31. if [ "$platform" == "macosx" ] ;then
  32. find $logDir -iname '*.log' | xargs rm -f
  33. find $logDir -iname '*.info' | xargs rm -f
  34. else
  35. find $logDir '*.log' | xargs rm -f
  36. find $logDir '*.info' | xargs rm -f
  37. fi
  38. #删除7天之前的埋点打包日期目录
  39. # zipDir=`get_config zip_statistic_path`
  40. # find $zipDir -type d -mtime +6 | xargs rm -rf