Skip to content

Commit

Permalink
Merge pull request #87 from ikifar2012/dev
Browse files Browse the repository at this point in the history
2022.12.1
  • Loading branch information
ikifar2012 authored Jan 7, 2023
2 parents 73b9927 + 3df54d7 commit f79f0c6
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
8 changes: 8 additions & 0 deletions remote-backup/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
# 2022.12.1

- 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

# 2022.12.0

- Bump Base Image to 13.0.0
Expand Down
2 changes: 1 addition & 1 deletion remote-backup/config.yaml
Original file line number Diff line number Diff line change
@@ -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}
Expand Down
10 changes: 5 additions & 5 deletions remote-backup/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down Expand Up @@ -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:-} -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}"
)
Expand Down Expand Up @@ -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
Expand All @@ -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" || 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
Expand Down

0 comments on commit f79f0c6

Please sign in to comment.