bash #!/bin/bash Date=`date+%Y%m%d-d-1day` BaseDir="/app-lication/nginx" NginxLogDir="$BaseDir/logs" LogName="access_www" if [-d$NginxLogDir]; then cd$NginxLogDir else exit1 fi if [-f${LogName}.log]; then /usr/bin/mv${LogName}.log${Date}_${LogName}.log fi $BaseDir/sbin/nginx-sreload