每日切一个日志

#!/bin/sh
LOG_PATH=/home/test/nginx/logs
NEW_LOG_PATH=/home/test/nginx/dayslog
NGING_PID=$(cat /home/test/nginx/logs/nginx.pid)
DATE=$(date -d "yesterday" +%Y%m%d)
mv $LOG_PATH/access.log $NEW_LOG_PATH/access_$(date +%Y%m%d).log
killall -s USR1 nginx

加入定时任务

0 0  * * *     /bin/sh  /home/bash/cat_nginx_log.sh

相关文章:

  • 2021-07-15
猜你喜欢
  • 2021-12-24
  • 2021-08-12
  • 2022-02-23
  • 2021-12-18
  • 2021-10-03
相关资源
相似解决方案