Kamis, 11 April 2019

How to clean catalina.out tomcat log without restart with truncate command

  Tidak ada komentar
Change working directory to apache tomcat folder
[[email protected] ~]# cd /opt/
[[email protected] opt]#
[[email protected] opt]# ls
apache-tomcat-7.0 Arcserve  jdk_oss  rh
[[email protected] opt]#
[[email protected] opt]# cd apache-tomcat-7.0/
[[email protected] apache-tomcat-7.0]#

Enter to apache tomcat logs folder
[[email protected] apache-tomcat-7.0]# cd logs/
[[email protected] logs]#
[[email protected] logs]# ls
Check the catalina.out log size and inode
[[email protected] logs]# ls -lshi | grep catalina.out
68311021  32G -rw-r--r--. 1 root root  32G Apr 12 13:07 catalina.out
[[email protected] logs]#
Perform truncate command
[[email protected] logs]# truncate -s 0 M catalina.out
[[email protected] logs]#
Check the catalina.out log size again, the size was become 0 and the inode still remain
[[email protected] logs]# ls -lshi catalina.out
68311021 0 -rw-r--r--. 1 root root 78K Apr 12 13:08 catalina.out
[[email protected] logs]#

Tidak ada komentar :

Posting Komentar