mirror of
https://github.com/ben-grande/qusal.git
synced 2025-12-17 01:14:20 -05:00
fix: separate host commands with end of options
This commit is contained in:
parent
b82a63e0ac
commit
9300c46def
2 changed files with 12 additions and 4 deletions
|
|
@ -1,4 +1,4 @@
|
||||||
# SPDX-FileCopyrightText: 2023 - 2024 Benjamin Grande M. S. <ben.grande.b@gmail.com>
|
# SPDX-FileCopyrightText: 2023 - 2025 Benjamin Grande M. S. <ben.grande.b@gmail.com>
|
||||||
#
|
#
|
||||||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||||
|
|
||||||
|
|
@ -17,10 +17,10 @@ compression: true
|
||||||
passphrase_text: my-password
|
passphrase_text: my-password
|
||||||
|
|
||||||
destination_vm: backup-ssh
|
destination_vm: backup-ssh
|
||||||
destination_path: ssh backup 'cat | tee -- /dir/qubes-backup-$(date +%Y-%m-%d-%H-%M-%S) >/dev/null'
|
destination_path: ssh backup -- dd iflag=fullblock conv=sync bs=4M of="/dir/qubes-backup-$(date +%Y-%m-%d-%H-%M-%S)"
|
||||||
|
|
||||||
## $ qvm-backup-find-last backup-ssh /dir/ 'ssh backup'
|
## $ qvm-backup-find-last backup-ssh /dir/ 'ssh backup'
|
||||||
## $ qvm-backup-restore --verify-only -d backup-ssh \
|
## $ qvm-backup-restore --verify-only -d backup-ssh \
|
||||||
## "ssh backup cat /dir/qubes-backup-file"
|
## "ssh backup -- cat -- /dir/qubes-backup-file"
|
||||||
|
|
||||||
# vim: ft=yaml
|
# vim: ft=yaml
|
||||||
|
|
|
||||||
|
|
@ -36,10 +36,18 @@ cmd="${3-}"
|
||||||
|
|
||||||
find_pattern="qubes-backup-*"
|
find_pattern="qubes-backup-*"
|
||||||
find_cmd="find \"${path}\" -maxdepth 1 -type f -name \"${find_pattern}\""
|
find_cmd="find \"${path}\" -maxdepth 1 -type f -name \"${find_pattern}\""
|
||||||
|
export LC_ALL=C
|
||||||
|
|
||||||
last_backup="$(list_last_backup)"
|
last_backup="$(list_last_backup)"
|
||||||
if test -z "${last_backup}"; then
|
if test -z "${last_backup}"; then
|
||||||
|
printf '%s\n' "error: no backup found" >&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
printf '%s\n' "${last_backup}"
|
max_path_size=4096
|
||||||
|
path_size=$(printf '%s' "${last_backup}" | wc -c)
|
||||||
|
if test "${path_size}" -gt "${max_path_size}"; then
|
||||||
|
printf '%s\n' "error: absolute path larger than ${max_path_size}" >&2
|
||||||
|
fi
|
||||||
|
|
||||||
|
printf '%.*s' "${max_path_size}" "${last_backup}"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue