#
###### My Shell Code #############
#! /bin/bash
date=`date +%Y%m%d`
logpt=/root/nginx/logs/access.log
logbk=/data/ng_log/$date
logpid=/root/nginx/logs/nginx.pid
logtag=$logbk/`date +%Y%m%d%H%m%S`
if test ! -d $logbk;then mkdir -p $logbk;fi
test -f $logpt | test -d $logbk && mv $logpt $logtag.log
if [ $? -eq 0 ];then
echo +++++++++++++ $logtag success ! ++++++++++ >>/data/ng_log/success.log
touch $logpt && kill -usr1 `cat $logpid`
else
echo +++++++++++++ $logtag failed ! ++++++++++ >>/data/ng_log/failed.log
fi
时间: 2024-10-12 13:23:28