With v6.18 we silently added a new script that allows linking Sonarr/Radarr/Lidarr database files to RAM, increasing access performance, reducing disk I/O and avoiding constant external HDD spinning due to the very regular access to these files. This script has gone through some rework and polishing with v6.23 and can now be enabled to automatically link those databases to RAM on boot and store them back to disk on shutdown. Many thanks to @Dr0bac at this place for providing valuable input and testing the development progress constantly: https://github.com/MichaIng/DietPi/issues/2689

The database contains settings for the program and information about handled media. The media files themselves are not included of course, only the information about: which are to be searched for, which have already been downloaded/imported etc.

After Sonarr, Radarr or Lidarr has been installed and you rebooted or reloaded the current terminal session at least one time, simply run dietpi-arr_to_RAM to get usage information:

When running dietpi-arr_to_RAM 1 all found databases are linked to RAM. You find them in at: /tmp/{sonarr,radarr,lidarr}_db_link
A backup for each linked file is created automatically (and recovered if required), so in case of a system crash only changes from the time of the link are lost. When running the above manually, before shutting down, run dietpi-arr_to_RAM 0 to store the files back to disk.

To have all databases linked to RAM at boot and stored back to disk on shutdown automatically, run: dietpi-arr_to_RAM enable

To further reduce the risk of lost info/settings you can run dietpi-arr_to_RAM 2 to update the backups. This can also be done per-program, e.g. dietpi-arr_to_RAM 2 sonarr to only update the Sonarr database backup. This allows the program itself to do this as well. Within Sonarr, Radarr and Lidarr web UI you can configure custom scripts to be run on certain triggers, e.g. when a download has been finished.
For this:

Open the web UI, e.g. for Sonarr <local_IP>:8989

Go to Settings

Select the tab Connect

Select + to add a new notification

Select Custom Script

Give it some name and select the trigger sliders as desired, On Download makes most sense here since after download the disk is spinning already and the info is important enough to assure it is preserved even on system crash.