nginx 定时任务完成日志切割
/usr/local/nginx/nginx_log_bak.sh 内容如下
#!bin/bash
log_path=/usr/local/nginx/logs;
bak_time=$(date +%Y-%m-%d.%H-%M-%S);
bak_source="$log_path"/access.log;
bak_target="$log_path"/"$bak_time"_access_log;
mv $bak_source $bak_target;
touch $bak_source;
kill -USR1 $(cat /usr/local/nginx/logs/nginx.pid)
定时任务
30 02 * * * sh /usr/local/nginx/nginx_log_bak.sh 每天凌晨2:30执行切割日志的shell脚本
相关推荐
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