mirror of
https://github.com/ben-grande/qusal.git
synced 2025-08-03 11:46:20 -04:00
refactor: initial commit
This commit is contained in:
commit
5eebd789ed
591 changed files with 18598 additions and 0 deletions
27
salt/dom0/files/bin/qvm-backup-find-last
Executable file
27
salt/dom0/files/bin/qvm-backup-find-last
Executable file
|
@ -0,0 +1,27 @@
|
|||
#!/bin/sh
|
||||
|
||||
# SPDX-FileCopyrightText: 2023 Benjamin Grande M. S. <ben.grande.b@gmail.com>
|
||||
#
|
||||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
set -eu
|
||||
|
||||
usage(){
|
||||
printf '%s\n' "usage: ${0##*/} QUBE DIR [CMD]"
|
||||
printf '%s\n' "example: ${0##*/} usb-qube /local/dir/backups"
|
||||
printf '%s\n' "example: ${0##*/} ssh-qube /remote/dir/backups 'ssh user@server'"
|
||||
printf '%s\n' "note: when using a remote login command (ssh), the DIR is the remote directory"
|
||||
printf '%s\n' "note: the directory specified must be the parent of where the backups are saved"
|
||||
exit 1
|
||||
}
|
||||
|
||||
if test -z "${2-}"; then
|
||||
usage
|
||||
fi
|
||||
|
||||
qube="$1"
|
||||
path="$2"
|
||||
cmd="${3-}"
|
||||
|
||||
# shellcheck disable=SC2086
|
||||
qvm-run -p "$qube" $cmd find "$path" -maxdepth 1 -type f -name "qubes-backup-*" 2>/dev/null | tail -1
|
Loading…
Add table
Add a link
Reference in a new issue