From cdc146d6dad20af768f725608254c1d8208b47c4 Mon Sep 17 00:00:00 2001 From: Matheson Steplock Date: Tue, 3 Jan 2023 20:43:51 +0000 Subject: [PATCH 1/7] correct null behaviour --- remote-backup/run.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/remote-backup/run.sh b/remote-backup/run.sh index edcc0b2..b3657c3 100755 --- a/remote-backup/run.sh +++ b/remote-backup/run.sh @@ -124,7 +124,7 @@ function create-local-backup { local unformatted_folders="${base_folders}" local unformatted_addons=$(bashio::supervisor.addons) - + if bashio::config.has_value "backup_exclude_folders"; then local -r backup_exclude_folders=$(bashio::config "backup_exclude_folders") bashio::log.notice "Excluded folder(s):\n${backup_exclude_folders}" @@ -286,7 +286,7 @@ function clone-to-remote { } function delete-local-backup { - if bashio::config.equals "backup_keep_local" "all" || bashio::config.equals "backup_keep_local" "null"; then + if bashio::config.equals "backup_keep_local" "all"; then bashio::log.debug "Keep all backups." return "${__BASHIO_EXIT_OK}" fi @@ -295,7 +295,7 @@ function delete-local-backup { bashio::log.warning "Failed to reload backups!" fi - if bashio::config.is_empty "backup_keep_local"; then + if bashio::config.is_empty "backup_keep_local" || bashio::config.equals "backup_keep_local" "null"; then if bashio::var.has_value "$SLUG"; then bashio::log.notice "Deleting local backup: ${SLUG}" if ! bashio::api.supervisor DELETE /backups/${SLUG}; then From a33aeb1f0349fc1aa55158fbf8b8b65fb6a57ddd Mon Sep 17 00:00:00 2001 From: Matheson Steplock Date: Thu, 5 Jan 2023 02:35:09 +0000 Subject: [PATCH 2/7] Add 0 --- remote-backup/run.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/remote-backup/run.sh b/remote-backup/run.sh index b3657c3..f80e1b8 100755 --- a/remote-backup/run.sh +++ b/remote-backup/run.sh @@ -295,7 +295,7 @@ function delete-local-backup { bashio::log.warning "Failed to reload backups!" fi - if bashio::config.is_empty "backup_keep_local" || bashio::config.equals "backup_keep_local" "null"; then + if bashio::config.is_empty "backup_keep_local" || bashio::config.equals "backup_keep_local" "null" || bashio::config.equals "keep_backup_local" "0"; then if bashio::var.has_value "$SLUG"; then bashio::log.notice "Deleting local backup: ${SLUG}" if ! bashio::api.supervisor DELETE /backups/${SLUG}; then From 2f9e439595b52910e8737927361ed5462f01831b Mon Sep 17 00:00:00 2001 From: Matheson Steplock Date: Fri, 6 Jan 2023 05:38:04 +0000 Subject: [PATCH 3/7] Fix Path --- remote-backup/run.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/remote-backup/run.sh b/remote-backup/run.sh index edcc0b2..ebae41b 100755 --- a/remote-backup/run.sh +++ b/remote-backup/run.sh @@ -124,7 +124,7 @@ function create-local-backup { local unformatted_folders="${base_folders}" local unformatted_addons=$(bashio::supervisor.addons) - + if bashio::config.has_value "backup_exclude_folders"; then local -r backup_exclude_folders=$(bashio::config "backup_exclude_folders") bashio::log.notice "Excluded folder(s):\n${backup_exclude_folders}" @@ -179,10 +179,10 @@ function copy-backup-to-remote { bashio::log.info "Copying backup using SFTP/SCP." ( sshpass -p "${REMOTE_PASSWORD}" \ - scp ${DEBUG_FLAG:-} -s -F "${SSH_HOME}/config" "/backup/${SLUG}.tar" remote:"\"${remote_directory}/${remote_name}.tar\"" || ( + scp ${DEBUG_FLAG:-} -s -F "${SSH_HOME}/config" "/backup/${SLUG}.tar" remote:"${remote_directory}/${remote_name}.tar" || ( bashio::log.warning "SFTP transfer failed, falling back to SCP: $(sshpass_error $?)" sshpass -p "${REMOTE_PASSWORD}" \ - scp ${DEBUG_FLAG:-} -O -F "${SSH_HOME}/config" "/backup/${SLUG}.tar" remote:"\"${remote_directory}/${remote_name}.tar\"" || ( + scp ${DEBUG_FLAG:-} -O -F "${SSH_HOME}/config" "/backup/${SLUG}.tar" remote:"${remote_directory}/${remote_name}.tar" || ( bashio::log.error "Error copying backup ${SLUG}.tar to ${remote_directory} on ${REMOTE_HOST}: $(sshpass_error $?)" return "${__BASHIO_EXIT_NOK}" ) From e734c8bc7499d31aaafb0b250208820307d6481b Mon Sep 17 00:00:00 2001 From: Matheson Steplock Date: Fri, 6 Jan 2023 16:47:44 -0500 Subject: [PATCH 4/7] -s flag invalid --- remote-backup/run.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/remote-backup/run.sh b/remote-backup/run.sh index ebae41b..6d71238 100755 --- a/remote-backup/run.sh +++ b/remote-backup/run.sh @@ -179,7 +179,7 @@ function copy-backup-to-remote { bashio::log.info "Copying backup using SFTP/SCP." ( sshpass -p "${REMOTE_PASSWORD}" \ - scp ${DEBUG_FLAG:-} -s -F "${SSH_HOME}/config" "/backup/${SLUG}.tar" remote:"${remote_directory}/${remote_name}.tar" || ( + scp ${DEBUG_FLAG:-} -F "${SSH_HOME}/config" "/backup/${SLUG}.tar" remote:"${remote_directory}/${remote_name}.tar" || ( bashio::log.warning "SFTP transfer failed, falling back to SCP: $(sshpass_error $?)" sshpass -p "${REMOTE_PASSWORD}" \ scp ${DEBUG_FLAG:-} -O -F "${SSH_HOME}/config" "/backup/${SLUG}.tar" remote:"${remote_directory}/${remote_name}.tar" || ( From 53857819c8386d492b6a9dcec3dfae1c3bc318c6 Mon Sep 17 00:00:00 2001 From: Matheson Steplock Date: Fri, 6 Jan 2023 17:13:47 -0500 Subject: [PATCH 5/7] Update Changelog --- remote-backup/CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/remote-backup/CHANGELOG.md b/remote-backup/CHANGELOG.md index 361324b..9280e1c 100644 --- a/remote-backup/CHANGELOG.md +++ b/remote-backup/CHANGELOG.md @@ -1,3 +1,10 @@ +# 2022.12.1 + +- Fix `scp: dest open` double quoting issue #86 addresses #84 +- Correct null behavior #85 addresses #81 + +**Full Changelog**: https://github.com/ikifar2012/remote-backup-addon/compare/2022.12.0...2022.12.1 + # 2022.12.0 - Bump Base Image to 13.0.0 From 1b69f72f13401516acfea9eaa71fa52c8673bb4f Mon Sep 17 00:00:00 2001 From: Matheson Steplock Date: Fri, 6 Jan 2023 17:14:29 -0500 Subject: [PATCH 6/7] Bump Version --- remote-backup/config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/remote-backup/config.yaml b/remote-backup/config.yaml index 7d8205b..ebd0318 100644 --- a/remote-backup/config.yaml +++ b/remote-backup/config.yaml @@ -1,5 +1,5 @@ name: Remote Backup -version: "2022.12.0" +version: "2022.12.1" slug: remote_backup description: Automatically create and transfer HA backups using SFTP (SCP), rsync, or rclone (experimental) image: ikifar/remote-backup-{arch} From 3df54d7cf69e251ff7db3e9e0e9ea3a4f368cfe9 Mon Sep 17 00:00:00 2001 From: Matheson Steplock Date: Fri, 6 Jan 2023 20:55:21 -0500 Subject: [PATCH 7/7] Bump Base Image to 13.0.1 --- remote-backup/CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/remote-backup/CHANGELOG.md b/remote-backup/CHANGELOG.md index 9280e1c..419162e 100644 --- a/remote-backup/CHANGELOG.md +++ b/remote-backup/CHANGELOG.md @@ -2,6 +2,7 @@ - Fix `scp: dest open` double quoting issue #86 addresses #84 - Correct null behavior #85 addresses #81 +- Bump Base Image to 13.0.1 **Full Changelog**: https://github.com/ikifar2012/remote-backup-addon/compare/2022.12.0...2022.12.1