-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3f8e5f9
commit 4cbc348
Showing
2 changed files
with
15 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
####################################### | ||
# Restic / Backup / Restore | ||
# | ||
# Version: 1.0.0 | ||
# Version: 2.0.0 | ||
# | ||
####################################### | ||
# Copyright [2024] [[email protected]] | ||
|
@@ -54,15 +54,25 @@ function initialize() { | |
declare command='restore' | ||
declare backup_tag="${1:-}" | ||
declare destination="${2:-}" | ||
declare backup_id="${3:-latest}" | ||
declare backup_host="${4:-}" | ||
|
||
bl64_dbg_set_level "$SYSOP64_CORE_SET_DEBUG" && bl64_msg_set_level "$SYSOP64_CORE_SET_VERBOSE" || exit $? | ||
initialize || exit $? | ||
|
||
bl64_msg_show_batch_start "$command" | ||
bl64_ui_ask_confirmation "Warning: destination content will be replaced (${destination})" && | ||
bl64_msg_show_info " | ||
Backup Tag : ${backup_tag} | ||
Backup ID : ${backup_id} | ||
Backup Host: ${backup_host} | ||
Destination: ${destination}" | ||
|
||
bl64_ui_ask_confirmation 'Warning: destination content will be replaced using absolute paths from backup' && | ||
restic_lib_run_restic \ | ||
--verbose \ | ||
--target "$destination" \ | ||
--tag "$backup_tag" \ | ||
${backup_host:+--host "$backup_host"} \ | ||
restore \ | ||
"$backup_tag" | ||
"$backup_id" | ||
bl64_msg_show_batch_finish $? "$command" |