which files can be deleted safe from raspberry?

Subforum for general discussions. Do not dump your questions/problems here, but try to find the subforum where it belongs!

Moderators: leecollings, remb0

Post Reply
BartSr
Posts: 347
Joined: Sunday 03 July 2016 16:16
Target OS: Raspberry Pi / ODroid
Domoticz version: V2024.3
Location: Netherlands
Contact:

which files can be deleted safe from raspberry?

Post by BartSr »

Content on my raspberry 3+ sd card is growing

Code: Select all

4,4G	/var
1,7G	/var/log
1,5G	/var/log/journal/9ad0dc29f0a2458cb78c7496645eb372
1,5G	/var/log/journal
1,5G	/var/lib
1,4G	/var/lib/docker
1,2G	/var/cache/apt
1,2G	/var/cache
1,1G	/var/cache/apt/archives
930M	/var/lib/docker/overlay2
Is it safe to delete these files being the biggest ones
info retrieved with command:

Code: Select all

sudo du -ah /var | sort -rh | head -1- > textfile.txt
TIA
Bart
Raspberry pi 3b
Arduino
KAKU
RfxCom
Zwave
OTGW
Chinese sensors temp (Dallas),movement
Tasmota
Esp8266 espeasy
MQTT
Kedi
Posts: 536
Joined: Monday 20 March 2023 14:41
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Somewhere in NL
Contact:

Re: which files can be deleted safe from raspberry?

Post by Kedi »

Probably your journal files are growing.
You can restrict that -> search for howto on the Internet.
Cache files can be deleted, but I don't think those will grow fast.
With the right commands you can delete unused / unwanted docker images if you want, again search the Internet.
All the other files should be untouched, most of them are there for a reason.

The command you used displays directories not files.
Logic will get you from A to B. Imagination will take you everywhere.
User avatar
Egregius
Posts: 2582
Joined: Thursday 09 April 2015 12:19
Target OS: Linux
Domoticz version: v2024.7
Location: Beitem, BE
Contact:

Re: which files can be deleted safe from raspberry?

Post by Egregius »

/var/log should be easy to clean.
And I suppose /var/cache/apt with "apt clean".
WouterO
Posts: 40
Joined: Sunday 14 May 2023 19:23
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: which files can be deleted safe from raspberry?

Post by WouterO »

This is my safe vacuum cleaner on my RPi:
sudo apt autoclean && sudo apt clean && sudo apt autoremove -y && sudo journalctl --vacuum-time=2d
Kedi
Posts: 536
Joined: Monday 20 March 2023 14:41
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Somewhere in NL
Contact:

Re: which files can be deleted safe from raspberry?

Post by Kedi »

For journalctl beter put the right instructions in /etc/systemd/journald.conf
Like SystemMaxUse=100M and SystemKeepFree=1G
Then you are done for the future.
Logic will get you from A to B. Imagination will take you everywhere.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest