From e852fa2e8bed717a583902ab86ae171fc4145a7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Fri, 8 Mar 2024 13:17:17 +0100 Subject: [PATCH] Use /var/lib/tvheadend as a data_dir --- manifest.toml | 5 +++++ scripts/backup | 7 +++++++ scripts/restore | 9 +++++++++ 3 files changed, 21 insertions(+) diff --git a/manifest.toml b/manifest.toml index adf4f3d..49bed50 100644 --- a/manifest.toml +++ b/manifest.toml @@ -79,6 +79,11 @@ ram.runtime = "50M" # FIXME: replace with an **estimate** minimum ram requiremen [resources.install_dir] + [resources.data_dir] + dir = "/var/lib/tvheadend" + owner = "hts" + group = "video" + [resources.permissions] main.url = "/" main.auth_header = false diff --git a/scripts/backup b/scripts/backup index be1f6f2..55ac547 100644 --- a/scripts/backup +++ b/scripts/backup @@ -21,6 +21,13 @@ ynh_print_info --message="Declaring files to be backed up..." ynh_backup --src_path="$install_dir" +#================================================= +# BACKUP THE DATA DIR +#================================================= + +### Only relevant if there is a "data_dir" resource for this app +ynh_backup --src_path="$data_dir" --is_big + #================================================= # BACKUP THE NGINX CONFIGURATION #================================================= diff --git a/scripts/restore b/scripts/restore index 6590800..65b4708 100644 --- a/scripts/restore +++ b/scripts/restore @@ -19,6 +19,15 @@ ynh_restore_file --origin_path="$install_dir" chown -R "$app:www-data" "$install_dir" +#================================================= +# RESTORE THE DATA DIRECTORY +#================================================= +ynh_script_progression --message="Restoring the data directory..." --weight=1 + +ynh_restore_file --origin_path="$data_dir" --not_mandatory + +chown -R "hts:video" "$data_dir" + #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #=================================================