How to kill/close log files that are open through lsof grep deleted?
6,703
Solution 1
looks like pid 20583
is keeping open the file. So search for it
ps aux | grep 20583
See what process is holding it open and restart the process or kill it.
Solution 2
If this is not a production system, just restart/kill postgres.
I'll check later for your answer, because there's a way to empty these files if you can't restart the application right now and you REALLY need the disk space urgently, but I wouldn't recommend it from the start.
Related videos on Youtube
![KyelJmD](https://i.stack.imgur.com/hCOqW.jpg?s=256&g=1)
Comments
-
KyelJmD almost 2 years
I have a deleted a large log file from our servers. so I executed this command to validate.
lsof -nP | grep '(deleted)'
and this showed up.
how can I permanently delete the results fo this lsof? I need to recliam the needed space on our hardrive
-
Gmck over 8 yearsHave you tired restarting postgres?
-
KyelJmD over 8 years@gmck I tried executing sudo /etc/init.d/postgresql stop but the file still persists/results still persists
-