From eaaa0ce02b1b46aa670a3d10bb04eab2dcdab387 Mon Sep 17 00:00:00 2001 From: th33xitus Date: Sun, 3 Apr 2022 13:57:24 +0200 Subject: [PATCH] fix(backup.sh): fix backup of klipper_config dir Signed-off-by: Dominik Willner th33xitus@gmail.com --- scripts/backup.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/backup.sh b/scripts/backup.sh index e7b6dfa..e13ba6c 100755 --- a/scripts/backup.sh +++ b/scripts/backup.sh @@ -13,6 +13,7 @@ set -e ### global variables BACKUP_DIR="${HOME}/kiauh-backups" +KLIPPER_CONFIG="${HOME}/klipper_config" function check_for_backup_dir(){ if [ ! -d "${BACKUP_DIR}" ]; then @@ -64,15 +65,14 @@ function backup_printer_cfg(){ } function backup_klipper_config_dir(){ - source_kiauh_ini check_for_backup_dir - if [ -d "${klipper_cfg_loc}" ]; then + if [ -d "${KLIPPER_CONFIG}" ]; then get_date status_msg "Timestamp: ${current_date}" status_msg "Create backup of the Klipper config directory ..." - config_folder_name="$(echo "${klipper_cfg_loc}" | rev | cut -d"/" -f1 | rev)" + config_folder_name="$(echo "${KLIPPER_CONFIG}" | rev | cut -d"/" -f1 | rev)" mkdir -p "${BACKUP_DIR}/${config_folder_name}/${current_date}" - cp -r "${klipper_cfg_loc}" "${_}" && ok_msg "Backup complete!" + cp -r "${KLIPPER_CONFIG}" "${_}" && ok_msg "Backup complete!" echo else ok_msg "No config directory found! Skipping backup ..."