You are Here:
Linux Lite 6.6 FINAL Released - Support for 22 Languages Added - See Release Announcement Section



How Do I delete/Clean Syslog?

Author (Read 26133 times)

0 Members and 10 Guests are viewing this topic.

Re: How Do I delete/Clean Syslog?
« Reply #7 on: August 21, 2020, 08:22:09 PM »
 

bigskill

  • New to Forums
  • *
  • 49
    Posts
  • Reputation: 5
  • Linux Lite Member
    • View Profile
Most of these suggestions are WAY over my head.
This is just an old x32 Lenovo laptop used for solitaire and light browsing.  not even email.
I deleted file using sudo method above.
I will keep an eye on it to see if it starts growing, then try reading it.
Thank You All.
 

Re: How Do I delete/Clean Syslog?
« Reply #6 on: August 20, 2020, 05:53:46 PM »
 

Moltke

  • Platinum Level Poster
  • **********
  • 1134
    Posts
  • Reputation: 126
  • Linux Lite Member
    • View Profile

  • CPU: amd athlon 64 x2

  • MEMORY: 4Gb

  • VIDEO CARD: amd radeon hd 6750

  • Kernel: 5.x
I have x32 LL installed, fresh install 3mos ago.I have been losing hard drive space.
I finally found where it went, SYSLOG is 42GB in size.  ./var/log/syslog
This is on a 70gb drive.
How do I delete or clean this?  It will not let me by normal means.
Is it safe to just delete it? HOW? 
Can it be cleaned/recovered?
How can I stop this from happening?
I tried Bleachbit, but I do not see an option for syslog.
Help Please
TIA

Is this a server or a regular desktop/laptop pc? I've never had/seen a log file that big in my system. In this article/tutorial they show you how to delete/remove/clean/empty a log file https://www.cyberciti.biz/faq/remove-log-files-in-linux-unix-bsd/

Read here for information on how to manage log files so they stop growing out of control https://www.loggly.com/ultimate-guide/managing-linux-logs/

Another good article on the topic https://www.networkworld.com/article/3428361/how-to-manage-logs-in-linux.html


Hope this helps! :)


Without each others help there ain't no hope for us :)
Need a translation service? https://www.deepl.com/es/translator
 

Re: How Do I delete/Clean Syslog?
« Reply #5 on: August 20, 2020, 04:17:12 PM »
 

minesheep

  • Forum Regular
  • ***
  • 140
    Posts
  • Reputation: 11
  • Linux Lite Member
    • View Profile

  • MEMORY: 4Gb

  • Kernel: 5.x
Thanks for replying but maybe you missed it
syslog is 42GB in size.
There is not enough room on the drive to make a copy.

That is not normal. You should open it in some way. There are many ways out here just be creative
  • Make normal copy of it after purging, (few mb - few 100 mb) however this may not be safe because if you someway fail the purging You can't restore the file that you emptied
  • If you are advanced enough use tools that do not require the file to be copied to RAM for example hex editor
  • just make partitial copy of larger file "dd if=/var/log/syslog of=/home/yourusername/partitialsyslog bs=1M count=512" change count=x to get more or less megabytes and home/yourusername/partitialsyslog to change name and path.
Note that using commands and programs that you run without sudo only allows reading of logs not modifying them in  any way, so this is safer (to leave sudo out)than using it when it's not necessary. Of course when you need it use it but read-only mode is safer for copying and accessing without the risk of damage.
 

Re: How Do I delete/Clean Syslog?
« Reply #4 on: August 20, 2020, 02:24:11 PM »
 

torreydale

  • PayPal Supporter
  • Platinum Level Poster
  • *****
  • 1588
    Posts
  • Reputation: 261
  • * Forum Moderator *
    • View Profile

  • CPU: Intel i5-3230M (4) @ 3.200GHz

  • MEMORY: 16Gb

  • VIDEO CARD: Intel 3rd Gen Core processor Graphics

  • Kernel: 5.x
@bigskill ,


Code: [Select]
truncate -s 0 /var/log/syslog

Also use Lite Tweaks instead of Bleachbit to keep your installation tuned.
Want to thank me?  Click my [Thank] link.
 

Re: How Do I delete/Clean Syslog?
« Reply #3 on: August 20, 2020, 12:55:52 PM »
 

bigskill

  • New to Forums
  • *
  • 49
    Posts
  • Reputation: 5
  • Linux Lite Member
    • View Profile
Thanks for replying but maybe you missed it
syslog is 42GB in size.
There is not enough room on the drive to make a copy.
 

Re: How Do I delete/Clean Syslog?
« Reply #2 on: August 20, 2020, 06:32:01 AM »
 

minesheep

  • Forum Regular
  • ***
  • 140
    Posts
  • Reputation: 11
  • Linux Lite Member
    • View Profile

  • MEMORY: 4Gb

  • Kernel: 5.x
To search the source what would be better place to start than logs especially syslog. You can make a copy of your syslog(s) to any location and read it to see whats making it that large. Its just a text file so you can use leafpad on LL4.8 and older and mousepad on LL5.0 (and newer) to open it. It should be safe to remove the compressed logs ending with .gz but I recommended to just move the files so if there is problem they can be moved back to "/var/logs/". If you want to move/delete logs type
Code: [Select]
sudo thunar in terminal. Enter your account password then do whatever you want with your logs but moving them to safe location is safer than just deleting them instantly.
 

How Do I delete/Clean Syslog?
« Reply #1 on: August 19, 2020, 06:08:11 PM »
 

bigskill

  • New to Forums
  • *
  • 49
    Posts
  • Reputation: 5
  • Linux Lite Member
    • View Profile
I have x32 LL installed, fresh install 3mos ago.I have been losing hard drive space.
I finally found where it went, SYSLOG is 42GB in size.  ./var/log/syslog
This is on a 70gb drive.
How do I delete or clean this?  It will not let me by normal means.
Is it safe to just delete it? HOW? 
Can it be cleaned/recovered?
How can I stop this from happening?
I tried Bleachbit, but I do not see an option for syslog.
Help Please
TIA
« Last Edit: August 19, 2020, 06:10:33 PM by bigskill »
 

 

-->
X Close Ad

Linux Lite 6.6 FINAL Released - Support for 22 Languages Added - See Release Announcement Section