错误日志也进行切割

pull/144/head
midoks 3 years ago
parent 6fefae29b5
commit 3ca99da108
  1. 4
      scripts/logs_backup.py

@ -65,6 +65,10 @@ if __name__ == '__main__':
else: else:
siteName = siteName.replace("-access_log", '') siteName = siteName.replace("-access_log", '')
oldFileName = logsPath + '/' + sys.argv[1] oldFileName = logsPath + '/' + sys.argv[1]
errOldFileName = logsPath + '/' + \
sys.argv[1].strip(".log") + ".error.log"
split_logs(oldFileName, num) split_logs(oldFileName, num)
if os.path.exists(errOldFileName):
split_logs(errOldFileName, num)
path = mw.getServerDir() path = mw.getServerDir()
os.system("kill -USR1 `cat " + path + "/openresty/nginx/logs/nginx.pid`") os.system("kill -USR1 `cat " + path + "/openresty/nginx/logs/nginx.pid`")

Loading…
Cancel
Save