From 76c869eff3fcd80e8c93f199ddcb809050319bff Mon Sep 17 00:00:00 2001 From: Christian Heller Date: Sat, 5 Apr 2025 00:15:44 +0200 Subject: [PATCH] Fix. --- testing/home/desktop/.local/bin/borgplom | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/testing/home/desktop/.local/bin/borgplom b/testing/home/desktop/.local/bin/borgplom index e660377..e25d97a 100755 --- a/testing/home/desktop/.local/bin/borgplom +++ b/testing/home/desktop/.local/bin/borgplom @@ -25,7 +25,7 @@ error_exit_with_usage() { error_exit "${1}\n\n$(print_usage)"; } exit_ok() { echo "$@"; exit 0; } # commands -USAGE_INDICES='backup_keys claim help info init keys orgpull' +USAGE_INDICES='backup_keys claim help info init keys orgpull orgpush' _run_borg_with_passphrase() { while true; do @@ -196,6 +196,18 @@ CMDFNC_orgpull() { borg extract --verbose "${_REPO}::${_ARCHIVE}" } +USAGE_DESC_orgpush='push org directory to repos' +CMDFNC_orgpush() { + expect_n_args 0 0 '' $@ + _NAME_ARCHIVE=orgdir + + ls -1 "${PATH_BORG_CONF_SECURITY}/" | while read _FILENAME; do + _REPO="$(cat $(path_repo_location ${_FILENAME}))" + _ARCHIVE="${_REPO}::${_NAME_ARCHIVE}-{utcnow:%Y-%m-%dT%H:%M}" + _run_borg_with_passphrase create --verbose "${_ARCHIVE}" ~/org + done +} + # parse args to execution if [ "$#" -lt 1 ]; then error_exit_with_usage 'missing command.' -- 2.30.2