日志压缩轮换
时间:2008-07-09 来源:colderhua
#!/bin/sh
cd /var/log
mv logfile.2.gz logfile.3.gz
mv logfile.1.gz logfile.2.gz
mv logfile logfile.1
cat /dev/null>logfile
chmod 600 logfile
kill -signal pid
gzip logfile.1
实现简单的日志轮换
cd /var/log
mv logfile.2.gz logfile.3.gz
mv logfile.1.gz logfile.2.gz
mv logfile logfile.1
cat /dev/null>logfile
chmod 600 logfile
kill -signal pid
gzip logfile.1
实现简单的日志轮换
相关阅读 更多 +