From 7baac51174cb0616dd090e7c300a25e53597b37c Mon Sep 17 00:00:00 2001 From: knoflook Date: Thu, 1 Dec 2022 11:28:06 +0100 Subject: [PATCH] add backup capability --- abra.sh | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/abra.sh b/abra.sh index 7c5fe57..d5126b9 100644 --- a/abra.sh +++ b/abra.sh @@ -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)