Deleting cache trash OK, outside of Firefox?

Hi again All, Prior to doing the complete system backups (as outlined in my last email), I enter Firefox and clear all history. But, during the backup (after booting into Recovery mode), rsync displays the copying of MANY files within this directory... /home/user/.cache/mozilla/firefox/abcd1234.default/cache2/trash/3363925 Given the names of some of those directories, I wonder if it is safe to delete them (rm -r) just before the backup? If so, at which level... trash? cache2? Thanks very much, in advance. Carl Turney Bayswater, Victoria

On Fri, May 15, 2015 at 12:35:39PM +1000, Carl Turney wrote:
Prior to doing the complete system backups (as outlined in my last email), I enter Firefox and clear all history.
why? it's not going to make that much difference in time taken or space consumed. and you can always use --exclude to tell rsync not to backup certain files or directories.
But, during the backup (after booting into Recovery mode), rsync displays the copying of MANY files within this directory...
/home/user/.cache/mozilla/firefox/abcd1234.default/cache2/trash/3363925
Given the names of some of those directories, I wonder if it is safe to delete them (rm -r) just before the backup?
If so, at which level... trash? cache2?
anyway, there's no need to delete before backing up, just tell rsync not to backup that directory. you could probably exclude the entire ~/.cache directory from the rsync backup. e.g. by adding --exclude='/home/*/.cache/' to your rsync command line. (NOTE: depending on exactly what you are backing up, you may or may not need the leading / on /home in that pattern. rsync filter patterns are strange - different to both glob patterns and regexps - and, IME, take some trial and error to get right. use the --dry-run option for testing. see the rsync man page and search for FILTER PATTERNS. IIRC if you are backing up from / then you want the pattern to start with /home, if you are backup up from /home then the exclude pattern would be better written as '*/.cache/') or if you just want to exclude the mozilla cache, try something like: --exclude='**.mozilla**cache**' you can get rsync to delete the directories from the target if they were backed up on previous runs with '--delete-excluded --force' craig -- craig sanders <cas@taz.net.au>

On Fri, 15 May 2015 01:35:55 PM Craig Sanders wrote:
On Fri, May 15, 2015 at 12:35:39PM +1000, Carl Turney wrote:
Prior to doing the complete system backups (as outlined in my last email), I enter Firefox and clear all history.
why? it's not going to make that much difference in time taken or space consumed.
I don't know about Mozilla, but my Chrome cache is about 500M on the laptop I'm using now (which wouldn't rank higher than 3rd place for active web browsing systems I run). That makes a difference in space used. I think that Chrome isn't particularly good about managing the cache, for example I think that the cache file from last year is very unlikely to be of any use. 500M+ of rapidly changing data for each of 3 systems makes a real difference when I'm storing incremental backups on a 500G disk! One thing I've been planning to do is to create a separate BTRFS subvolume for ~/.cache, that would exclude it from the BTRFS snapshot backups as well as the removable media backups (which are from the snapshot backups).
But, during the backup (after booting into Recovery mode), rsync displays the copying of MANY files within this directory...
/home/user/.cache/mozilla/firefox/abcd1234.default/cache2/trash/3363925
Given the names of some of those directories, I wonder if it is safe to delete them (rm -r) just before the backup?
If so, at which level... trash? cache2?
anyway, there's no need to delete before backing up, just tell rsync not to backup that directory.
Of course a decision to not backup files means that the application won't have access to them after a restore. So it's worth knowing what happens if you delete them. A quick test would be a good idea. -- My Main Blog http://etbe.coker.com.au/ My Documents Blog http://doc.coker.com.au/

On Fri, May 15, 2015 at 02:02:10PM +1000, Russell Coker wrote:
On Fri, 15 May 2015 01:35:55 PM Craig Sanders wrote:
On Fri, May 15, 2015 at 12:35:39PM +1000, Carl Turney wrote:
Prior to doing the complete system backups (as outlined in my last email), I enter Firefox and clear all history.
why? it's not going to make that much difference in time taken or space consumed.
I don't know about Mozilla, but my Chrome cache is about 500M on the laptop I'm using now (which wouldn't rank higher than 3rd place for active web browsing systems I run). That makes a difference in space used.
500M isn't much these days. even 5GB is hardly noticable these days.
I think that Chrome isn't particularly good about managing the cache, for example I think that the cache file from last year is very unlikely to be of any use.
so run a cron job to clear it out every so often - checking to make sure chromium isn't running before deleting anything.
anyway, there's no need to delete before backing up, just tell rsync not to backup that directory.
Of course a decision to not backup files means that the application won't have access to them after a restore. So it's worth knowing what happens if you delete them. A quick test would be a good idea.
a cache is, by definition, transient, replaceable data. there should be no problem deleting it (or not backing up). if some program breaks because its cache is missing, then that's a bug that needs to be fixed. craig -- craig sanders <cas@taz.net.au>

Not answering the backup issue, but was wondering whether running a local caching proxy (eg:squid) would not be a better approach that using browser cache? It means that the same cache could be used by several browsers and other software. Daniel. On 15/05/15 13:35, Craig Sanders wrote:
On Fri, May 15, 2015 at 12:35:39PM +1000, Carl Turney wrote:
Prior to doing the complete system backups (as outlined in my last email), I enter Firefox and clear all history.
why? it's not going to make that much difference in time taken or space consumed.
and you can always use --exclude to tell rsync not to backup certain files or directories.
But, during the backup (after booting into Recovery mode), rsync displays the copying of MANY files within this directory...
/home/user/.cache/mozilla/firefox/abcd1234.default/cache2/trash/3363925
Given the names of some of those directories, I wonder if it is safe to delete them (rm -r) just before the backup?
If so, at which level... trash? cache2?
anyway, there's no need to delete before backing up, just tell rsync not to backup that directory.
you could probably exclude the entire ~/.cache directory from the rsync backup.
e.g. by adding --exclude='/home/*/.cache/' to your rsync command line.
(NOTE: depending on exactly what you are backing up, you may or may not need the leading / on /home in that pattern. rsync filter patterns are strange - different to both glob patterns and regexps - and, IME, take some trial and error to get right. use the --dry-run option for testing. see the rsync man page and search for FILTER PATTERNS. IIRC if you are backing up from / then you want the pattern to start with /home, if you are backup up from /home then the exclude pattern would be better written as '*/.cache/')
or if you just want to exclude the mozilla cache, try something like:
--exclude='**.mozilla**cache**'
you can get rsync to delete the directories from the target if they were backed up on previous runs with '--delete-excluded --force'
craig

On Fri, 15 May 2015 02:16:35 PM Daniel Jitnah wrote:
Not answering the backup issue, but was wondering whether running a local caching proxy (eg:squid) would not be a better approach that using browser cache? It means that the same cache could be used by several browsers and other software.
You can run Squid locally, but the browsers will cache stuff anyway. -- My Main Blog http://etbe.coker.com.au/ My Documents Blog http://doc.coker.com.au/

On Fri, May 15, 2015 at 02:16:35PM +1000, Daniel Jitnah wrote:
Not answering the backup issue, but was wondering whether running a local caching proxy (eg:squid) would not be a better approach that using browser cache? It means that the same cache could be used by several browsers and other software.
that's what i do. i configure iceweasel etc to use minimal cache (<1MB) and run squid. i run several different browsers on my desktop and there are several machines here running various browsers - the squid cache benefits them all. craig -- craig sanders <cas@taz.net.au>

On 15/05/15 13:35, Craig Sanders wrote:
On Fri, May 15, 2015 at 12:35:39PM +1000, Carl Turney wrote:
Prior to doing the complete system backups (as outlined in my last email), I enter Firefox and clear all history.
why? it's not going to make that much difference in time taken or space consumed.
and you can always use --exclude to tell rsync not to backup certain files or directories.
True. I'm over-worrying. Thanks for the hints, everyone. Cheers, Carl

On 15/05/15 12:35, Carl Turney wrote:
Hi again All,
Prior to doing the complete system backups (as outlined in my last email), I enter Firefox and clear all history.
Carl Turney hi
there is a firefox plugin that deletes the local cache https://addons.mozilla.org/en-us/firefox/addon/empty-cache-button/ also you can set firefox to delete the local cache on exit but both of these imply an empty cache next time you use firefox Steve
participants (5)
-
Carl Turney
-
Craig Sanders
-
Daniel Jitnah
-
Russell Coker
-
Steve Roylance