Temporary (Sandboxed) Trees

I often have a reason to work with a test tree.

It might be to experiment with a new version of Gramps. But more often it is because a tool, view, statistic readout or report cannot be limited to the ancestors/descendants of a proband. It considers the whole (huge) tree. So I have to enforce the limit manually.

So I make a duplicate of the main 40,000 person Tree and prune it severely.

(Keep only: Descendants of the current proband, ancestors of children of the proband, and anyone within 2 degrees of separation of those ancestors and descendants. This keeps the immediate blended family members.
Alternatively, use the Fitler+ gramplet to scrape the current view filtering parameter into a custom filter and delete anyone who doesnā€™t match.)

Then set the Themes to the unpleasant (in my opinion) highā€contrast theme as a reminder Iā€™m working in a ā€˜disposableā€™ tree. (The annoyance factor keeps me from dwelling too long and thoughtlessly adding to its culled population.) And add the Session Log gramplet to the Dashboard.

At the end of the session, Iā€™ll review the session logā€¦ to remind me of what was touched. (I can do a compete individual report, if substantive changes make that advisable. Then use the report to roll my ā€˜oops, changed the wrong treeā€™ into the main tree.) Then use the Family Manager to delete the current (temporary) Tree, load a different tree, change the Theme back to normal, and reset the Session Log.

But it would be great if this could be done more simply. Such as a button in the Family Trees manager to make a sacrificial clone of the selected Tree folder from the Database directory in an OS managed Temporary cache. Then load (converting if necessary) that clone, set the theme and add the Session Log to the dashboard.

I know that I can export an XML and load into a new tree. Build this would not have the idiosyncrasies and tedium. (Having to switch to the appropriate production version of Gramps to avoid accidentally converting its schema, having IDs converted during import, changing the last used timestamp on the source tree.) And I wouldnā€™t have remember to dispose of the sandbox clone when done.

Instead of tens of minutes setting up a sandbox and cleaning up afterwards, sandboxing would take mere seconds.

Benefits of letting the OS Temporary folder manage a disposable clone Tree

As an expert on the Fedora Linux OS, describe how it manages its temporary files. In particular, where the temporaty files are stores, how long they are retained and what causes files to be purged.

Fedora Linux manages temporary files using systemd-tmpfiles, which provides a structured and configurable approach.

Storage Locations

  1. /tmp: Used for temporary files that do not need to persist across reboots. It is typically backed by tmpfs (RAM/swap) and is cleared on system reboot[2][6].
  2. /var/tmp: Used for files that need to persist across reboots. It resides on persistent storage[2][6].

Retention Periods

  • Files in /tmp are removed after 10 days of inactivity by default[7][9].
  • Files in /var/tmp are removed after 30 days of inactivity[7][9].

Purging Mechanism

  • Temporary files are cleaned using tools like tmpwatch, which removes files based on their last access time[9][10].
  • The cleanup behavior can be configured via /usr/lib/tmpfiles.d/tmp.conf or similar configuration files, allowing customization of retention periods and exclusions[10].

This system ensures efficient management of temporary files while preventing unnecessary accumulation.

Citations:
[1] Configuration of Temporary Files with systemd-tmpfiles | Baeldung on Linux
[2] Where is the temporary directory in Linux? - Super User
[3] linux - How long are files kept in /var/tmp/, and how to use the directory? - Super User
[4] https://quizlet.com/60101893/os-chapter-11-test-flash-cards/
[5] Managing temporary files with systemd-tmpfiles on RHEL 7 | Red Hat Developer
[6] Using /tmp/ and /var/tmp/ Safely
[7] FedoraForum.org
[8] Reddit - Dive into anything
[9] clearing out /tmp safely - users - Fedora mailing-lists
[10] linux - When does /tmp get cleared? - Server Fault
[11] Temporary Files :: Fedora Docs


Answer from Perplexity: https://www.perplexity.ai/search/as-an-expert-on-the-fedora-lin-vcE3geU1RMOZyHFj0WKRpw?utm_source=copy_output

Another workflow is to us a VM software on your main computer with a master that is preloaded with the OS, Gramps and a ā€œdefaultā€ database and other tools you use for this type of research report writing. Then you open a read-only client that can be temporary updated with anything you like (called UML).

Most VMā€™s have functionality for setting up this type of environments, and you can create as many you like, temporary save them and when you shut them down everything you have done inside the image is gone, next time you open or create a new client, it is a fresh copyā€¦

In most advanced VMā€™s you can even upgrade or update the OS and all the apps in the temporary image.

If you need to create permanent changes you must do that in the master image.

Both VirtualBox and QEMU have this functionality (UML or User-Mode Linux).
Hyper-V also have this functionality.
I am sure there is a lot of other VM systems that also have this, but I have never tested the ā€œnew and fancy onesā€, shxt, I donā€™t even know their names.

The biggest job will be to create the Master image as you like it, and manage to keep it as simple as possibleā€¦

On Windows I found this to be a lot easier than to run stuff in the Windows Sandbox mode because it was so limited, just a handful of MS software was partially supported back when I tried it out.

You configure all your Defaults" in the Master Image before you set it ā€œread-onlyā€, so you will not need to change the themes in Gramps, you will not need to be careful with changes you do etc.
Because it will open as a separate window, if you use something similar to GWSL for windows you will just open the application you want, but I do not know how that is configured for Linux Hosts.

Just a tip.

2 Likes

Ohhā€¦ I should add that when using this approach, you can of course run it while your main family tree is open in the main installation of Gramps.

You can also run this in parallel with other VM clients that is not read only enabledā€¦ you just use different images or for some VMs you just set different configurations for the different clients so that the changes are permanently saved in the full/partial client imageā€¦

There is a lot of benefits running a VM for the way you work, as well as for everyone that like to test out some features or a software over some time without bloating their main OS installation.

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