site  contact  subhomenews

Cache folders excluded from snapshots

October 15, 2022 — BarryK

When there is a version upgrade, the 'init' script in the initrd creates a snapshot of the /mnt/wkg/.session folder as a 'rw-*.sfs' file. For example, when upgraded to Easy 4.4.1, /mnt/wkg/releases/easy-4.4.1/rw-4.4.1.sfs got created.

These snapshots are handy, as you can roll back to them if desired. This can be done via the menu "Filesystem -> Easy Version Control". This tool also allows creating snapshots at any time.

I noticed that the 'rw-*.sfs' file is getting very big. This is mostly because '.cache' folders are getting saved. For example, my /home/firefox/.cache folder is currently about 1GB.

I have edited the 'init' script in the initrd and /usr/local/easy_version/easy-version-control, to exclude all '.cache' folders when creating a 'rw-*.sfs' snapshot.

EDIT:
Clarification, the above fix only applies when running with direct save to the .session folder. The default is to run in RAM, requiring a save operation to flush the current session to the .session folder. In the latter case, /etc/rc.d/rw-merge excludes all '.cache' folders.
   

Tags: easy