0

I have these log files:

72K     /var/log/dist-upgrade
4.0K    /var/log/samba/cores/smbd
4.0K    /var/log/samba/cores/nmbd
12K     /var/log/samba/cores
84K     /var/log/samba
44K     /var/log/gdm
4.0K    /var/log/bittorrent
1.6M    /var/log/installer
4.0K    /var/log/asterisk/cdr-custom
19M     /var/log/asterisk/cdr-csv
1.2G    /var/log/asterisk
4.0K    /var/log/apparmor
4.0K    /var/log/unattended-upgrades
36K     /var/log/cups
4.0K    /var/log/news
120K    /var/log/proftpd
12K     /var/log/fsck
28K     /var/log/apt
1.2G    /var/log

Could I please get some help cleaning these log files?

  • Is this du output? Or something else? Can you fix the formatting so it's readable? – user535733 Sep 7 at 6:20
  • Asterisk logging is pretty well documented. – Jos Sep 7 at 7:38
  • 1
    Normally your system will run logrotate to move and compress logs over a certain size. Logrotate keeps a configured number of each logs, and delete old ones automatically. If some logfile grows a lot. you should look in to that file and fix the problem - if any. – Soren A Sep 7 at 7:41
  • question: why? The largest outside of asterisk is 120K. and see the link Jos posted on that. – Rinzwind Sep 7 at 8:07
0

by clean do you mean remove/delete?

if so then this has already been answered:

As described in those answers, to delete all logs open terminal, CTRL+ALT+T, and run:

sudo rm /var/log/*

to delete a specific log file run:

sudo rm /var/log/*nameoflogfile*.log 

Although as stated in this answer, it is also worth checking through the logs to find out what exactly is causing your logs to grow so large.

| improve this answer | |
  • "sudo rm /var/log/*| No. You do > /var/log/{logfile} There are services that are active that require the log file to be present. – Rinzwind Sep 7 at 8:06
0

Simple log cleanning

sudo /etc/cron.daily/logrotate

# optionnal, delete log archives
sudo find /var/log -type f -iname *.gz -delete

Find more about freeing disk space on root partition : https://askubuntu.com/a/1161181/77093

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.