add backup capability

This commit is contained in:
knoflook 2022-12-01 11:28:06 +01:00
parent bf75cde0b5
commit 7baac51174
1 changed files with 31 additions and 0 deletions

31
abra.sh
View File

@ -1 +1,32 @@
<<<<<<< HEAD
export APP_ENTRYPOINT_VERSION=v1
||||||| parent of 87367d9 (add backup capability)
=======
APP_DIR="app:/data"
_backup_app() {
# Copied _abra_backup_dir to make UX better on restore and backup
{
abra__src_="$1"
abra__dst_="-"
}
# shellcheck disable=SC2154
FILENAME="$(basename "$1").tar"
debug "Copying '$1' to '$FILENAME'"
silence
mkdir -p /tmp/abra
sub_app_cp > /tmp/abra/$FILENAME
unsilence
}
abra_backup_app() {
# shellcheck disable=SC2154
ARK_FILENAME="$ABRA_BACKUP_DIR/${abra__app_}_app_$(date +%F).tar.gz"
# Cant be FILENAME as that gets changed by something
_backup_app $APP_DIR
success "Backed up 'app' to $ARK_FILENAME"
}
>>>>>>> 87367d9 (add backup capability)