#!/bin/bash log_path="/usr/local/nginx/logs/" mv ${log_path}eshop_access.log ${log_path}eshop_access_$(date -d "yesterday" +%Y_%m_%d).log nginx_pid=`ps aux |grep -E 'nginx: master process'|grep -v 'grep'|awk '{print $2}'` kill -USR1 $nginx_pid