Think before you speak, read before you think.

truncate 日志文件

by

in

文件过大,大几十G

ls -lhai newrelic_agent.log
truncate -s 0 newrelic_agent.log
ls -lhai newrelic_agent.log

清理前后的 inode number, 文件权限都没有发生变化
清理完之后 tail -f newrelic_agent.log 观察是否能正常写入

https://computingforgeeks.com/how-to-empty-truncate-log-files-in-linux/


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *