nginx 日志每日轮询脚本
#!/bin/bash # This script run at 00:00 # 00 00 * * * log_daily.sh # The Nginx logs path LOG_PATH="/usr/local/nginx/logs" for log in `ls $LOG_PATH`; do echo $log | grep '.log$' > /dev/null if [ $? -eq 0 ];then NEW_LOG_FILE_PATH=$LOG_PATH/${log}_`date -d yesterday +%Y_%m_%d` mv $LOG_PATH/$log $NEW_LOG_FILE_PATH chmod 666 $NEW_LOG_FILE_PATH fi done # ask nginx to generate new log file kill -USR1 `cat /usr/local/nginx/var/nginx.pid`
相关推荐
zhuxue 2020-10-14
zhangbingb 2020-09-21
HeronLinuxampARM 2020-09-14
美丽的泡沫 2020-09-08
goodstudy 2020-08-19
luvhl 2020-08-17
littleFatty 2020-08-16
gamestart0 2020-08-15
URML 2020-08-15
sfkong 2020-08-02
82941732 2020-07-27
偏头痛杨 2020-07-18
timewind 2020-07-04
89407707 2020-06-27
xiaoxiaoCNDS 2020-06-26
lyjava 2020-06-26
运算符用于执行程序代码运算,会针对一个以上操作数项目来进行运算。以上实例中 7、5 和 12 是操作数。关系运算符用于计算结果是否为 true 或者 false。逻辑运算符用于测定变量或值之间的逻辑。
ChaITSimpleLove 2020-06-25
Strongding 2020-06-25