no changes after deleting files
Hi ,
I have deleted some log files because of space crunch and after removed I still see the same percentage of space as how it was earlier before removal. So can you suggest what could be the reason and how to fix it out? Thanks ---------- Post added 07-02-12 at 06:03 PM ---------- Sorry forgot to mention the server details it it centos 5.2 |
Code:
updatedb |
so updatedb will make changes.
my questions , even after removal of log file, I see the same filesize in the var , no changes has been taken effect with df -h |
Removed a log file or cleared it?
So how did you remove it? If you wanted to clear a file: Code:
cat /dev/null > aptitude |
Try looking for zero size files:
Code:
find /var/log -type f -size 0k |
For log files, you should really use the logrotate tool http://linux.die.net/man/8/logrotate, see /etc/logrotate.d (dir).
FYI, if a process has a file open, the the disk space is not returned after deletion until the file is released http://linux.die.net/man/2/unlink i.e. the file just becomes invisible to ls, find cmds etc. You shouldn't normally delete an open file anyway; see lsof http://linux.die.net/man/8/lsof fuser http://linux.die.net/man/1/fuser |
Quote:
Code:
>logfile |
Thanks TobiSGD, I'll add that to my script!
|
Quote:
Try: Code:
# lsof +L1 /var | egrep 'PID|deleted' |
Thanks lot!!
|
All times are GMT -5. The time now is 06:49 PM. |