fix(backups): add backup function for OctoEverywhere

fix #380

Signed-off-by: Dominik Willner <th33xitus@gmail.com>
This commit is contained in:
th33xitus
2023-08-30 19:42:32 +02:00
parent f45da66e9e
commit a50dce20de
2 changed files with 19 additions and 1 deletions

View File

@@ -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
}