From df0310856c83ad384fe5ebd24584ac0992fb59e0 Mon Sep 17 00:00:00 2001 From: Heavybullets8 Date: Sun, 2 Jun 2024 12:57:23 -0600 Subject: [PATCH] refactor custom dataset path --- .default.config.ini | 3 ++- functions/backup_restore/handler.sh | 7 ++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.default.config.ini b/.default.config.ini index 9ceea6a..16f1917 100644 --- a/.default.config.ini +++ b/.default.config.ini @@ -58,7 +58,8 @@ backup_snapshot_streams=false ## String options ## # Uncomment the following line to specify a custom dataset location for backups -# custom_dataset_location= +# Example: dataset_absolute_path=/mnt/tank/backups +dataset_absolute_path=DEFAULT # Maximum size of a backup stream, be careful when setting this higher # Especially considering PV's for plex, sonarr, radarr, etc. can be quite large diff --git a/functions/backup_restore/handler.sh b/functions/backup_restore/handler.sh index c5cb973..b158639 100644 --- a/functions/backup_restore/handler.sh +++ b/functions/backup_restore/handler.sh @@ -9,7 +9,12 @@ read_config() { # Set the default options using the config file export export_enabled="${BACKUP__BACKUP__export_enabled:-false}" export full_backup_enabled="${BACKUP__BACKUP__full_backup_enabled:-false}" - export dataset_path="${BACKUP__BACKUP__custom_dataset_location:-/mnt/$(get_apps_pool)/heavyscript_backups}" + export dataset_path + if [[ "${BACKUP__BACKUP__dataset_absolute_path:-"DEFAULT"}" == "DEFAULT" ]]; then + dataset_path="/mnt/$(get_apps_pool)/heavyscript_backups" + else + dataset_path="${BACKUP__BACKUP__dataset_absolute_path:-"/mnt/$(get_apps_pool)/heavyscript_backups"}" + fi } # Function to handle backups and exports