-
make a big log file to be truncate if the log is not important anymore or...Computer/linux 2012. 3. 19. 23:02Situation file_to_be_truncated is a debug or monitor log file is going to be a big size due to whatever reasons. I would like to be truncated or be ignored this log at this moment, but this file is connected to a running process.
Solution one of my colleagues gives me a brilliant solution to do that without interrupting a process.
cat /dev/null > file_to_be_truncated
Example
Before 786658068 Mar 19 09:40 Xterm.log.2012.03.13.09.42.58.2611
After 0 Mar 19 09:53 Xterm.log.2012.03.13.09.42.58.2611
After few mins 1747 Mar 19 10:07 Xterm.log.2012.03.13.09.42.58.2611
'Computer > linux' 카테고리의 다른 글
recover deleted files on an android device in debian (0) 2012.04.08 how to mount a kindle via commands (0) 2012.03.01 How to eject a Kindle Touch 3rd Generation when it is USB drive mode in Linux command (0) 2012.02.07