Automatically delete certain files on close

Hi I’m not sure this is the right place to ask the following question, if not move it and let me know.

Maybe some of you know about it, but I (along with many other user) have an issue with how Firefox (since version 98) automatically downloads files like PDF to the download folder! and I end up with multiple versions of the same file that I looked at on line on several different occasions. I looked online for solution, but none worked.
So after a while I had an idea for a work around:
I created the folder ‘firefoxtemp’ in / tmp/firefoxtemp
I changed the download directory in Firefox to /tmp/firefoxtemp
I also changed some options in ‘about:config’ to always be presented with the option to ‘Open/View’ or ‘Save’ file
When I choose to ‘Save’, I can pick where to save the file. When I choose ‘Open/View’ it opens up in Firefox and also gets downloaded to /temp/firefoxtemp
I then need to remember to run ‘Bleachbit’ once a week or so and it will clear all the files inside /temp/firefoxtemp

My question here is for advice on how to write and implement a small script that will do what ‘Bleachbit’ does but automatically on close (or opening) of Firefox, or the whole system without me having to remember to rum ‘Bleachbit’

If you use /tmp instead of /temp, then you won’t need any script. /tmp is a tmpfs, which means that its contents live in virtual memory — in practice, this means RAM, but they can be paged out if more RAM is needed — and will automatically be wiped clean when the system shuts down.

Not even that one?


Thanks ‘Aragorn’ that’s great! I tested it and it works perfectly no need for scripts.

Thanks ‘maycne’ but I already had that set to true, that’s what I meant when I said

1 Like

Read again, they are different configurations.

Also, there is another one which, when set to false, disables the feature “improvement”, thus reverting to the download behavior prior.

Silly question probably…

Why do you continue to go to the online version of the PDF, when you already have a copy downloaded?

Why not simply open the downloaded file in your pdf viewer?

Does the PDF source get edited/changed on a regular basis?

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.