LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   deleting /var/log (https://www.linuxquestions.org/questions/linux-newbie-8/deleting-var-log-620401/)

(((X))) 02-11-2008 04:28 PM

deleting /var/log
 
I would like to delete everything in /var/log to get more space, I donīt need them anymore..
I donī t want to get into trouble with that, so I want to know it is safe or not:)

leonscape 02-11-2008 04:37 PM

Usually log files are made with ordering so you'll get:

dmesg
dmesg.0
dmesg.1.gz
dmesg.2.gz
etc...

The compressed ones are usually very safe to remove, the ones with 0 are usually back ups of the live logs, you don't want to be deleting dmesg when the kernels trying to write to it. The others without this scheme you can usually delete the older versions quite easily, but I'd leave the latest, you never know whats trying to write to them or when it will be useful.

Most system delete the oldest ones anyway, I know my system only keeps dmesg.4.gz anything older gets removed automatically.

gilead 02-11-2008 06:09 PM

If you do have files numbered as leonscape describes, you are probably running logrotate. In the files /etc/logrotate.conf and /etc/logrotate.d/* you can modify the rotate directive to use fewer backups. For example, if you see the line rotate 4 change it to rotate 1


All times are GMT -5. The time now is 07:33 AM.