How to clean haproxy-info log without restart with truncate command
Check the disk size
[user@localhost log]$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda3 94G 81G 8.9G 91% /
tmpfs 939M 0 939M 0% /dev/shm
/dev/sda1 488M 172M 291M 38% /boot
[user@localhost log]$
Check the size and inode number
[user@localhost log]$ ls -lshi | grep haproxy-info.log
2359684 72G -rwxrwxrwx 1 root root 72G May 3 14:47 haproxy-info.log
[user@localhost log]$
Perform the truncate command
[user@locahost log]$ truncate -s 0 M haproxy-info.log
[user@localhost log]$
Check the size and inode number
[user@localhost log]$ ls -lshi | grep haproxy-info.log
2359684 220K -rwxrwxrwx 1 root root 217K May 3 14:48 haproxy-info.log
[user@localhost log]$
The disk size have decrease
[user@localhost log]$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda3 94G 8.9G 81G 10% /
tmpfs 939M 0 939M 0% /dev/shm
/dev/sda1 488M 172M 291M 38% /boot
[user@localhost log]$
Tidak ada komentar :
Posting Komentar