You are not logged in.

#1 2017-10-27 06:50:14

DoXer
Member
Registered: 2017-08-27
Posts: 36

[Solved] ~/.cache needs backup?

Hi,
just creating my backup-strategy with borg backup.

Is it ok to exclude the whole ~/.cache directory, or is there important data included?

Regards
Michael

Last edited by DoXer (2017-10-29 05:40:05)


--
Regards
Michael

Offline

#2 2017-10-27 06:56:44

hcjl
Member
From: berlin
Registered: 2007-06-29
Posts: 330

Re: [Solved] ~/.cache needs backup?

As the name already indicates it contains just cached data. Many backup tools already exclude things like cache, trash, etc. in their default configs.

Offline

#3 2017-10-27 10:08:28

DoXer
Member
Registered: 2017-08-27
Posts: 36

Re: [Solved] ~/.cache needs backup?

Perfect,
borg has a parameter for this and I followed the instructions:

--exclude-caches      exclude directories that contain a CACHEDIR.TAG file (http://www.brynosaurus.com/cachedir/spec.html)

--
Regards
Michael

Offline

#4 2017-10-27 11:20:37

hcjl
Member
From: berlin
Registered: 2007-06-29
Posts: 330

Re: [Solved] ~/.cache needs backup?

Borg really looks promising. I currently only use rsync or rsync based tools (rsnapshot) for backup. Maybe I should give borg I try.

Offline

#5 2017-10-27 12:46:02

drcouzelis
Member
From: Connecticut, USA
Registered: 2009-11-09
Posts: 4,092
Website

Re: [Solved] ~/.cache needs backup?

I'm going to throw out my general rule (in hopes that someone smarter will correct me if I'm wrong!)...

On any computer device (desktop, phone...), if a file or folder has the word "cache" in it, then it can be safely erased at any time.

Offline

#6 2017-10-27 18:28:32

progandy
Member
Registered: 2012-05-17
Posts: 5,321

Re: [Solved] ~/.cache needs backup?

drcouzelis wrote:

I'm going to throw out my general rule (in hopes that someone smarter will correct me if I'm wrong!)...

On any computer device (desktop, phone...), if a file or folder has the word "cache" in it, then it can be safely erased at any time.

That works as long as you don't have badly written software that stores important data in a cache directory smile
Also take care if it is a cache for online data you want to preserve for offline reading. Don't delete it when you have no internet access.


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' | alias ENGLISH='LANG=C.UTF-8 ' |

Offline

#7 2017-10-27 19:15:49

ugjka
Member
From: Latvia
Registered: 2014-04-01
Posts: 1,960
Website

Re: [Solved] ~/.cache needs backup?

sometimes you can fix some issues by just deleting all caches

Online

#8 2017-10-28 03:23:37

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,193

Re: [Solved] ~/.cache needs backup?

drcouzelis wrote:

I'm going to throw out my general rule (in hopes that someone smarter will correct me if I'm wrong!)...

On any computer device (desktop, phone...), if a file or folder has the word "cache" in it, then it can be safely erased at any time.

rmr /usr/bin/*cache*

?


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#9 2017-10-28 03:37:56

waitnsea
Member
From: France
Registered: 2013-02-10
Posts: 67

Re: [Solved] ~/.cache needs backup?

hcjl wrote:

Borg really looks promising. I currently only use rsync or rsync based tools (rsnapshot) for backup. Maybe I should give borg I try.

Hi,
Have a look on my contribution on (french) Wiki
Thanks for any correction/addition or Official Wiki translation

Offline

#10 2017-10-28 10:15:50

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,734
Website

Re: [Solved] ~/.cache needs backup?

I mount ~/.cache to tmpfs so it never makes writes to my SSD nor does it retain contents between boots.
From /etc/fstab

tmpfs /home/facade/.cache tmpfs relatime,nodev,nosuid,size=180M 0 0

Offline

#11 2017-10-28 10:18:37

Alad
Wiki Admin/IRC Op
From: Bagelstan
Registered: 2014-05-04
Posts: 2,420
Website

Re: [Solved] ~/.cache needs backup?

Are we still arguing about SSD writes in 2017? ~/.cache can contain files of arbitrary size. If that size=180m get exceeded, in the best case programs will break because they can no longer write to ~/.cache.

Last edited by Alad (2017-10-28 10:27:08)


Mods are just community members who have the occasionally necessary option to move threads around and edit posts. -- Trilby

Offline

#12 2017-10-28 10:34:59

ugjka
Member
From: Latvia
Registered: 2014-04-01
Posts: 1,960
Website

Re: [Solved] ~/.cache needs backup?

Mythbusters need to be revived to take on SSD myths

Online

#13 2017-10-28 11:14:22

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,734
Website

Re: [Solved] ~/.cache needs backup?

Alad wrote:

Are we still arguing about SSD writes in 2017?

...You seem to be the only one wanting to start an argument.

Carefully re-read my post.  I stated two facts about an /etc/fstab setting and shared it in the post, period.
1) No writes to filesystem.
2) Automatically erased on a reboot.

Alad wrote:

~/.cache can contain files of arbitrary size. If that size=180m get exceeded, in the best case programs will break because they can no longer write to ~/.cache.

You are correct.  My use cases never gave issues exceeding 180m.  Others may wish to monitor the dir size and modify the setting accordingly.

Offline

#14 2017-10-28 13:09:46

DoXer
Member
Registered: 2017-08-27
Posts: 36

Re: [Solved] ~/.cache needs backup?

BTW: We are getting more and more off topic. smile

Last edited by DoXer (2017-10-28 13:09:59)


--
Regards
Michael

Offline

#15 2017-10-28 13:24:17

2ManyDogs
Forum Fellow
Registered: 2012-01-15
Posts: 4,648

Re: [Solved] ~/.cache needs backup?

DoXer wrote:

BTW: We are getting more and more off topic. smile

You could help by marking your thread [SOLVED] (I think you have your answer).

Offline

#16 2017-10-30 13:01:56

drcouzelis
Member
From: Connecticut, USA
Registered: 2009-11-09
Posts: 4,092
Website

Re: [Solved] ~/.cache needs backup?

cfr wrote:
drcouzelis wrote:

I'm going to throw out my general rule (in hopes that someone smarter will correct me if I'm wrong!)...

On any computer device (desktop, phone...), if a file or folder has the word "cache" in it, then it can be safely erased at any time.

rmr /usr/bin/*cache*

?

All right, all right, you win. wink

For anyone reading this, do not use the "rm" command above. You might lose something you want, like "/usr/bin/gtk-update-icon-cache".

Offline

#17 2017-10-31 00:36:50

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,193

Re: [Solved] ~/.cache needs backup?

drcouzelis wrote:
cfr wrote:
drcouzelis wrote:

I'm going to throw out my general rule (in hopes that someone smarter will correct me if I'm wrong!)...

On any computer device (desktop, phone...), if a file or folder has the word "cache" in it, then it can be safely erased at any time.

rmr /usr/bin/*cache*

?

All right, all right, you win. wink

For anyone reading this, do not use the "rm" command above. You might lose something you want, like "/usr/bin/gtk-update-icon-cache".

Note my deliberate typo.

Last edited by cfr (2017-10-31 00:37:04)


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

Board footer

Powered by FluxBB