From a50dce20debb2954ceb670ed5d8d2270a743e01f Mon Sep 17 00:00:00 2001 From: th33xitus Date: Wed, 30 Aug 2023 19:42:32 +0200 Subject: [PATCH] fix(backups): add backup function for OctoEverywhere fix #380 Signed-off-by: Dominik Willner --- scripts/backup.sh | 16 ++++++++++++++++ scripts/ui/backup_menu.sh | 4 +++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/scripts/backup.sh b/scripts/backup.sh index cdb9af7..d885895 100755 --- a/scripts/backup.sh +++ b/scripts/backup.sh @@ -191,3 +191,19 @@ function backup_telegram_bot() { print_error "Can't back up MoonrakerTelegramBot directory!\n Not found!" fi } + +function backup_octoeverywhere() { + local current_date + + if [[ -d ${OCTOEVERYWHERE_DIR} ]] ; then + status_msg "Creating OctoEverywhere backup ..." + check_for_backup_dir + current_date=$(get_date) + status_msg "Timestamp: ${current_date}" + mkdir -p "${BACKUP_DIR}/OctoEverywhere-backups/${current_date}" + cp -r "${OCTOEVERYWHERE_DIR}" "${_}" && cp -r "${OCTOEVERYWHERE_ENV}" "${_}" + print_confirm "OctoEverywhere backup complete!" + else + print_error "Can't back up OctoEverywhere directory!\n Not found!" + fi +} diff --git a/scripts/ui/backup_menu.sh b/scripts/ui/backup_menu.sh index 297c2f0..97bae83 100755 --- a/scripts/ui/backup_menu.sh +++ b/scripts/ui/backup_menu.sh @@ -25,7 +25,7 @@ function backup_ui() { echo -e "| | |" echo -e "| Klipper Webinterface: | Other: |" echo -e "| 5) [Mainsail] | 9) [Telegram Bot] |" - echo -e "| 6) [Fluidd] | |" + echo -e "| 6) [Fluidd] | 10) [OctoEverywhere] |" back_footer } @@ -54,6 +54,8 @@ function backup_menu() { do_action "backup_octoprint" "backup_ui";; 9) do_action "backup_telegram_bot" "backup_ui";; + 10) + do_action "backup_octoeverywhere" "backup_ui";; B|b) clear; main_menu; break;; *)