Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2022.12.1 #87

Merged
merged 9 commits into from
Jan 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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