NGINX 多域名日志切割备份脚本
#!/bin/bash # Info : cut logs for nginx # Author : elain # CTime : 2011.06.08 # This script run at 00:00 # The Nginx logs path Logs_Path=”/elain/logs/nginx” log_filenames=`/bin/ls $Logs_Path |grep -v nginx|grep -v logsbak` for log_name in $log_filenames do /bin/mv $Logs_Path/$log_name $Logs_Path/logsbak/`date -d yesterday +%Y%m%d%H%M`-$log_name done kill -USR1 `cat /elain/apps/nginx/nginx.pid`
cron定时任务
# Info : 每天凌晨0点切割一次NGINX日志 # Author : elain # CTime : 2011.06.08 00 00 * * * /root/scripts/cut_nginx_log.sh
相关推荐
nginxs 2020-11-14
Guanjs0 2020-11-13
小木兮子 2020-11-11
yserver 2020-11-11
ssihc0 2020-11-11
windle 2020-11-10
HanksWang 2020-11-10
liuchen0 2020-11-10
Freshairx 2020-11-10
ccschan 2020-11-10
liwf 2020-11-10
Guanjs0 2020-11-09
AderStep 2020-11-09
zrtlin 2020-11-09
mqfcu 2020-11-10
windle 2020-10-29