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 #=================================================