批量压缩Nginx日志 脚本

#批量压缩Nginx日志
#!/bin/bash
ls access_*.log >ls.txt
for s in $(cat ls.txt)
do
	echo tar -zcf ${s:0:15}.tar.gz ${s:0:15}.log
	tar -zcf ${s:0:15}.tar.gz ${s:0:15}.log
	echo rm -f ${s:0:15}.log
	rm -f ${s:0:15}.log
done

发布了84 篇原创文章 · 获赞 15 · 访问量 14万+

猜你喜欢

转载自blog.csdn.net/TDGX2004/article/details/9098427