Jumat, 03 Mei 2019

How to clean haproxy-info log without restart with truncate command

  Tidak ada komentar
Check the disk size
[[email protected] 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
[[email protected] log]$
Check the size and inode number
[[email protected] log]$ ls -lshi | grep haproxy-info.log
2359684  72G -rwxrwxrwx  1 root   root    72G May  3 14:47 haproxy-info.log
[[email protected] log]$
Perform the truncate command
[[email protected] log]$ truncate -s 0 M haproxy-info.log
[[email protected] log]$
Check the size and inode number
[[email protected] log]$ ls -lshi | grep haproxy-info.log
2359684 220K -rwxrwxrwx  1 root   root   217K May  3 14:48 haproxy-info.log
[[email protected] log]$
The disk size have decrease
[[email protected] 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
[[email protected] log]$

Tidak ada komentar :

Posting Komentar