Hi,
I try to execute bleachbit (as user) on every boot. So I used kcron, and while running that task manually works perfect I was wondering if it executed on reboot as well.
Is there some type of logfile? I don’t know where to look, most answers on the internet refer to ubuntu. Or are there better ways to do so? I’m still new to modern linux.
I get “no entries”
And obviously it didn’t run, because when I run it manually after reboot there are files to delete that shouldn’t be there if it had run like it should.
This is /var/spool/cron/*user*
#Bleachbit Systemstart
@reboot /usr/bin/bleachbit -c --preset
# Diese Datei wurde von KCron generiert Thursday, 3. April 2025 16:04:26 Mitteleuropäische Sommerzeit.
#! /bin/bash
## run bleachbit with preset
bleachbit -c --preset
echo "$(date) All Cleaned Up!" >> /home/username/cleanup.log
Make this executable and put it somewhere in your path. For example /home/username/.local/bin
Or anywhere you like. Just exclude the location in Bleachbit.
To add this location to your path, you need something like export PATH="$HOME/.local/bin:$PATH" in your .bashrc
This is just an example. You need to adjust it to your situation by replacing username with your real user name and so on. Also the .targets may need some adjustment. As it is it should work for shutdown, reboot and suspension I think. Research further.
Bleachbit stir up high sentiments among some members of the Linux community. You have been warned
This is all part of me transitioning from Windows to Linux. With that script I can replace Bleachbit one day by letting it do what Bleachbit is doing now, but I’ll have to do it step by step.
The last time I used Linux was more than 20 years ago, a lot of things have changed and I have to relearn a lot.
In this case it seems that the cron-service wasn’t even running.
I’ve watched some videos on Youtube since your last reply, and now I was able to get it working with systemd, thank you very much for your help!!
It doesn’t run on boot, but that’s not necessary since it does its job at shutdown. I still don’t know what you mean by “add this location to your path”.
Adding a directory to your path means including that directory in the list of locations where the system searches for executable files.
You can type echo $PATH in a terminal to see those locations.
I have to mention also, please exercise caution when using Bleachbit. many users complaining at it for breaking their system tend not to pay attention to its setting and remove more things than they should.
Add the things you absolutely don’t want to be deleted to its whitelist. And never run it as root!
I’m quite an experienced user in Windows, so I am careful enough in what I am choosing to delete. In a way Windows and Linux are quite similar. In Windows I knew how to navigate through the registry, the policies, the .ini-files and so on. My main issue with switching to Linux is WHERE to find the files I am looking for and what the counterparts are named. Bleachbit is helping me to find them before I start using rm -rf * to get rid of things.
When users start to complain about a program it’s often not the program’s fault.
This will delete all the files and folders in the current directory. It will do it recursively and forcibly without prompting for confirmation. Be careful with it and please don’t use it with sudo in a system directory.
There are also GUI applications for disk usage analyze like baobab (GTK based) or filelight (QT based). To be run in a terminal ncdu will give also some visual over the filesystem structure and usage.