New on LowEndTalk? Please Register and read our Community Rules.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
Comments
congrats, you cleaned your logs without destroying your VPS!
In fact, nothing can go wrong besides you wondering who just brute force logged into your SSH if you do:
Edit: What he said ^.^
@Cirium
The dash prevents I/O streams to be closed?
The logs I get split every now and again.
EI:
access_log-1
access_log-2
I use the dash to just delete the old ones without deleting the "access_log" currently being written.
(rm -rf /var/log/access_log-*)
Deleted all logs, cleared up around 3.2GB
But, weird thing, i got the radio running on it, and i got 3.6GB of songs, but df -h shows 9.9GB used disk space.... and i just cant find wich files uses that many space?
Can someone also help me with that?
http://www.cyberciti.biz/faq/find-large-files-linux/
Already tried that, not showing big files...
http://en.wikipedia.org/wiki/Sparse_file might be at work here
Thanks for that information, never heard of sparse file before
If you deleted logs that were large and in-use, the space doesn't get freed up until those processes close those files. If you want to see open files that are "deleted", do this:
sudo /usr/sbin/lsof | grep deleted
I think the worse that could happen is an app freaking out that a file/folder location doesn't exist anymore, a simple restart fixes that. (kind of like if you set up nginx to log to /var/log/nginx/ you would just have to make sure the nginx subfolder exists and just restart nginx).
Is there any way to safely remove them?
ummm... logrotate?
I love logrotate just nix' off the older *gz backups.
if it's a cpanel box be careful with removing log files.. better practice to just echo them out
echo > file_to_be_truncated
truncates the file safely, in case any active process has it open.
EDIT: Should mention that this is what @twain was referring to.
@Adduc thanks I should have been a little more detailed there..
Have you thought about setting up logrotate?
+1 vote for logrotate
I'm still a linux newbie and wrote a blog entry about how i've configured it.
malachisoord.com/blog/post/2012/05/30/logrotate-my-first-encounters
@inverse - what are you using for your blog? static site generator script?
It's my own static site generator inspired by Kudos but for CodeIgniter.