What I want to do is execute a simple shell script on KDE exit (or logout) that will remove files from my home directory (all the browser caches, etc). I have the script, and I know how to do this from /etc/rc0.d, but that seems a bit drastic. There is autostart in systemsettings, but no autostop that I have found yet. Any way to get a shell script to run as kde exits?
Announcement
Collapse
No announcement yet.
[solved] Script to delete cache files on KDE exit
Collapse
This topic is closed.
X
X
-
Re: [solved] Script to delete cache files on KDE exit
BTW, I'm interested in that shell script...Multibooting: Kubuntu Noble 24.04
Before: Jammy 22.04, Focal 20.04, Precise 12.04 Xenial 16.04 and Bionic 18.04
Win XP, 7 & 10 sadly
Using Linux since June, 2008
- Top
- Bottom
Comment
-
Re: [solved] Script to delete cache files on KDE exit
This is still a work-in-progress. It's based on another script I found on the web.
The last line that's commented out, I'm not so sure about -- it was in the original script, but it seems to cause mozilla serious problems, so for now I don't run it.
There are more elegant versions using find.
The idea here is to clean out browser history, caches, etc. As I find new ones, I add them.
Code:#!/bin/sh rm -r ~/.adobe/* rm -r ~/.macromedia/* rm -r ~/.cache/Arora/* rm -r ~/.cache/google-chrome/* rm -r ~/.cache/midori/* rm -r ~/.cache/chromium/* rm -r ~/.cache/virtuoso* rm -r ~/.thumbnails/* rm -r ~/.bash-history rm -r ~/.recently-used* rm -r ~/.mozilla/firefox/ddploqlg.default/Cache/* rm -r ~/.mozilla/firefox/ddploqlg.default/Cache.Trash/* rm -r ~/.kde/share/apps/konqueror/konq_history* rm -r ~/.kde/share/apps/konqueror/closeditems_saved rm -r ~/.kde/share/apps/konqueror/autosave/* rm -r ~/.local/share/data/Arora/cookies* rm -r ~/.local/share/data/Arora/history* #find ~/.mozilla -type f -name '*.sqlite' -delete
We only have to look at ourselves to see how intelligent life might develop into something we wouldn't want to meet. -- Stephen Hawking
- Top
- Bottom
Comment
-
Re: [solved] Script to delete cache files on KDE exit
I have to ask why you are attempting to do with a script, what can be done with settings configuration in Konqueror and Firefox? Both can be configured to clear history, caches, and off-line content upon exit.Windows no longer obstructs my view.
Using Kubuntu Linux since March 23, 2007.
"It is a capital mistake to theorize before one has data." - Sherlock Holmes
- Top
- Bottom
Comment
-
Re: [solved] Script to delete cache files on KDE exit
Konqueror and firefox are not the only issues. And I'm not sure I entirely trust them. I do have extensions in firefox that are supposed to clear that stuff, but there always seems to be something there.
What prompted this is that while doing rsync backups, I noticed that a lot of garbage is being backed up from the home directory. I just have a basic dislike/distrust of applications that keep databases on what I do. I come from a Windows background, enough said So when I find one of them, I add their data to a purge script.
We only have to look at ourselves to see how intelligent life might develop into something we wouldn't want to meet. -- Stephen Hawking
- Top
- Bottom
Comment
-
Re: [solved] Script to delete cache files on KDE exit
Ah. Any reason why you don't opt to use IgnorantGuru's kscrubber.sh script? It is recommended [required?] to be run outside of an X session, and it takes a while to finish (depends on the amount of data accumulated and speed of your CPU), but it does a wonderful job of cleaning ones system. I use it before making my own backups.Windows no longer obstructs my view.
Using Kubuntu Linux since March 23, 2007.
"It is a capital mistake to theorize before one has data." - Sherlock Holmes
- Top
- Bottom
Comment
-
Re: [solved] Script to delete cache files on KDE exit
Yeah, that's what started me on this.
http://igurublog.wordpress.com/downl...ipt-kscrubber/
I haven't looked at it for a while, but thanks for reminding me, I will. I remember using once, and it clobbered something important, but it has probably evolved since then, so it's worth another look.
We only have to look at ourselves to see how intelligent life might develop into something we wouldn't want to meet. -- Stephen Hawking
- Top
- Bottom
Comment
-
Re: [solved] Script to delete cache files on KDE exit
If nothing else, you can see what IG has identified for cleansing, and you can include them in your script. kscrubber.sh uses secure-delete and sqlite3. The script doesn't just delete the files/folders, but actually 'securely deletes' them by performing a series of writes over the data with zeros (IIRC).
Script: kscrubberWindows no longer obstructs my view.
Using Kubuntu Linux since March 23, 2007.
"It is a capital mistake to theorize before one has data." - Sherlock Holmes
- Top
- Bottom
Comment
Comment