标签:linux
#!/bin/bash
logs_path="/opt/nginx/logs/"
pid_path="/opt/nginx/logs/nginx.pid"
mv ${logs_path}access.log ${logs_path}access_$(date -d "yesterday" +"%Y%m%d").log
kill -USR1 `cat ${pid_path}`
crontab -e
00 00 * * * sh /opt/shell/cutnginx.sh
该脚本不能执行可能原因:
脚本没有X权限
在非root用户下调用时需要密码,放到root用户下即可
本文出自 “dba天空” 博客,请务必保留此出处http://9425473.blog.51cto.com/9415473/1660920
标签:linux
原文地址:http://9425473.blog.51cto.com/9415473/1660920