TL;DR: How to delete logs that take up huge size. How to possibly auto delete them?
Hello there! My Raspberry Pi was throwing some errors when I tried updating a specific program on it (NextCloud/NextCloudPi), it said that there was no storage left.
I checked using the help from this article:
df -h
This displays the available disk space on every partition in a human readable format.
Now, this threw me the following:
Filesystem Size Used Avail Use% Mounted on /dev/root 59G 59G 0 100% /
Showing that my /dev/root filesystem was ENTIRELY full. I was wondering why, so utilized this Raspberry Pi forum post to help me find a command to check:
sudo du -sh * I executed this in the root directory
Here is told me that the “var†directory used 55GB of storage. Using 55GB of 59GB available is quite suspicious.
So, I executed the command again inside of the “var†directory. Here it told me that 55GB were used up in the “log†directory. So, I checked the log directory:
0 alternatives.log 4.0K alternatives.log.1 4.0K alternatives.log.2.gz 4.0K alternatives.log.3.gz 4.0K alternatives.log.4.gz 4.0K alternatives.log.5.gz 4.0K alternatives.log.6.gz 4.0K alternatives.log.7.gz 4.0K alternatives.log.8.gz 1.8M apache2 144K apt 648K auth.log 800K auth.log.1 52K auth.log.2.gz 52K auth.log.3.gz 52K auth.log.4.gz 0 btmp 0 btmp.1 34G daemon.log 91M daemon.log.1 7.1M daemon.log.2.gz 3.9M daemon.log.3.gz 7.8M daemon.log.4.gz 0 debug 4.0K debug.1 4.0K debug.2.gz 4.0K debug.3.gz 4.0K debug.4.gz 8.0K dpkg.log 20K dpkg.log.1 24K dpkg.log.10.gz 4.0K dpkg.log.2.gz 4.0K dpkg.log.3.gz 4.0K dpkg.log.4.gz 16K dpkg.log.5.gz 4.0K dpkg.log.6.gz 4.0K dpkg.log.7.gz 4.0K dpkg.log.8.gz 4.0K dpkg.log.9.gz 4.0K fail2ban.log 12K fail2ban.log.1 4.0K fail2ban.log.2.gz 4.0K fail2ban.log.3.gz 4.0K fail2ban.log.4.gz 4.0K fontconfig.log 720K kern.log 1.8M kern.log.1 160K kern.log.2.gz 240K kern.log.3.gz 136K kern.log.4.gz 8.0K lastlog 60K letsencrypt 0 mail.err 4.0K mail.err.1 4.0K mail.info 4.0K mail.info.1 4.0K mail.info.2.gz 4.0K mail.info.3.gz 4.0K mail.info.4.gz 4.0K mail.log 4.0K mail.log.1 4.0K mail.log.2.gz 4.0K mail.log.3.gz 4.0K mail.log.4.gz 0 mail.warn 4.0K mail.warn.1 4.0K mail.warn.2.gz 4.0K mail.warn.3.gz 4.0K mail.warn.4.gz 724K messages 1.8M messages.1 160K messages.2.gz 240K messages.3.gz 140K messages.4.gz 32K mysql 220K ncp.log 52K ncp.log.1.gz 64K ncp.log.2.gz 48K ncp.log.3.gz 56K ncp.log.4.gz 28K nginx 4.0K php7.3-fpm.log 4.0K php7.3-fpm.log.1 4.0K php7.3-fpm.log.10.gz 4.0K php7.3-fpm.log.11.gz 4.0K php7.3-fpm.log.12.gz 4.0K php7.3-fpm.log.2.gz 4.0K php7.3-fpm.log.3.gz 4.0K php7.3-fpm.log.4.gz 4.0K php7.3-fpm.log.5.gz 4.0K php7.3-fpm.log.6.gz 4.0K php7.3-fpm.log.7.gz 4.0K php7.3-fpm.log.8.gz 4.0K php7.3-fpm.log.9.gz 320K postgresql 4.0K private 4.0K prometheus 1.4M redis 4.0K samba 12G syslog 5.6G syslog.1 40M syslog.2.gz 25M syslog.3.gz 31M syslog.4.gz 14M syslog.5.gz 1.4M syslog.6.gz 1.3M syslog.7.gz 4.0K sysstat 0 ufw.log 128K unattended-upgrades 0 user.log 4.0K user.log.1 4.0K user.log.2.gz 4.0K user.log.3.gz 4.0K user.log.4.gz 0 vsftpd.log 4.0K vsftpd.log.1 56K vsftpd.log.2 4.0K wicd 232K wtmp
Most notably: 34G daemon.log 12G syslog 5.6G syslog.1
Why do these logs take up so much storage? I mean, I guess the server has been running for a year now without interruption.
Can I delete these logs? Is that okay? Should I end all processes whilst doing so? Is this log size normal? I wasn't aware that it was logging at all. Can I set up a system where logs are automatically deleted after a week/month/year?
Any response would help!
submitted by /u/NotErikUden
[link] [comments]
More...
My 64GB MicroSD (running Raspbian Lite) is full, but it's all because of Logs?
The Raspberry Pi is a series of credit card-sized single-board computers developed in the United Kingdom by the Raspberry Pi Foundation to promote the teaching of basic computer science in schools and developing countries.
Post Reply
1 post
• Page 1 of 1
- /RaspberryPi
- Corporate
- Posts: 2449
- Joined: Wed Jun 05, 2019 1:29 am
Post Reply
1 post
• Page 1 of 1
Return to “Raspberry Pi Forum”
Jump to
- From Retro to Current
- ↳ Classified Ads
- ↳ Community
- ↳ Marketplace
- ↳ Jobs
- ↳ Dating
- ↳ Housing
- Nintendo Forums
- ↳ SNES Classic Edition Forum
- ↳ Switch Forum
- ↳ NES Classic Edition Forum
- ↳ Wii U Forum
- ↳ 3DS Forum
- ↳ Wii Forum
- ↳ DS Forum
- ↳ Gamecube Forum
- ↳ Game Boy Advance Forum
- ↳ Game Boy Color Forum
- ↳ Nintendo 64 Forum
- ↳ Super Nintendo Forum
- ↳ Game Boy Forum
- ↳ Nintendo Entertainment System Forum
- ↳ Game & Watch Forum
- SONY Forums
- ↳ PlayStation 5 Forum
- ↳ PlayStation Classic Forum
- ↳ PlayStation 4 Forum
- ↳ PlayStation Vita Forum
- ↳ PlayStation 3 Forum
- ↳ PlayStation Portable Forum
- ↳ PlayStation 2 Forum
- ↳ PlayStation 1 Forum
- Microsoft Forums
- ↳ Xbox Series Forum
- ↳ Xbox One Forum
- ↳ Xbox 360 Forum
- ↳ Xbox Forum
- SEGA Forums
- ↳ Genesis Mini Forum
- ↳ Dreamcast Forums
- ↳ Sega Saturn Forum
- ↳ Genesis Forum
- ↳ Master System Forum
- Other System Forums
- ↳ General Discussion
- ↳ Other Console Forum
- ↳ Arcade Cabinet Forum
- ↳ Windows, Mac, & Linux Forum
- ↳ Atomiswave Forums
- ↳ WWW.ATOMISWAVE.NET
- ↳ General Discussion
- ↳ Tech Support
- ↳ System Setups
- ↳ Modified Moderboards
- ↳ Home Consoles & Systems
- ↳ Arcade & Candy Cabinets
- ↳ Marketplace
- ↳ Video Game Marketplace
- ↳ Game Discussion
- ↳ Video Game Catalogs
- ↳ FAQs, Reviews, & Guides
- ↳ Assorted Discussion
- ↳ Custom Ideas
- ↳ Open Discussion
- ↳ SNK Neo Geo Forums
- ↳ General Discussion
- ↳ Buying & Selling
- ↳ Tech Support
- ↳ Systems
- ↳ Neo Geo Arcade Stick Pro Forum
- ↳ Neo Geo Mini Forum
- ↳ Neo Geo X Forum
- ↳ Neo Geo CD Forum
- ↳ Neo Geo MVS Forum
- ↳ TurboGrafx-16 Forums
- ↳ General Discussion
- ↳ Marketplace
- ↳ Magazine Scans
- ↳ Games
- ↳ TurboChip/HuCard Forum
- ↳ CD-ROM²/Super CD-ROM²/Arcade CD-ROM² Forum
- ↳ Systems
- ↳ TurboGrafx-16 Mini Forum
- ↳ TurboDuo Forum
- ↳ TurboExpress/PC Engine GT/LT Forum
- ↳ SuperGrafx Forum
- ↳ TurboGrafx-CD/PC Engine CD Forum
- ↳ TurboGrafx-16/PC Engine Core Forum
- ↳ Raspberry Pi Forum
- ↳ Atari Forum