Skip to content

Commit c070a30

Browse files
committed
Remove the need for Home_Paht/path_to_BackupScript
1 parent ee5b24c commit c070a30

File tree

4 files changed

+28
-15
lines changed

4 files changed

+28
-15
lines changed

Executor/Notifier

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,13 @@ done
5858
to_terminal() {
5959
# Send message to log and log file
6060
local msg="$1"
61-
printf "$msg\n"
61+
printf %b "$msg\n"
6262
}
6363

6464
to_logfile() {
6565
# Send message to log and log file
6666
local msg="$1"
67-
printf "$msg\n" >> "$log_file"
67+
printf %b "$msg\n" >> "$log_file"
6868
}
6969

7070
to_unraid_notification() {

Executor/ResticBackupExec

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ $NOTIFIER --timestamps "false"
6464

6565
output=$(eval "$cmd" 2>&1)
6666
exit_code=$?
67-
output=${output//%/%%}
6867
$NOTIFIER --message "$output" --timestamps "false"
6968

7069
################################# Evaluation ################################

Executor/ResticPruneExec

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ $NOTIFIER --timestamps "false"
4343

4444
output=$(eval "$cmd" 2>&1)
4545
exit_code=$?
46-
output=${output//%/%%}
4746
$NOTIFIER --message "$output" --timestamps "false"
4847

4948
################################# Evaluation ################################

Jobs/JobTemplate

Lines changed: 26 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212
#
1313
unique_job_name="ChangeMeToUniqueName" # Unique job name. Do not use space or underscore!!!
1414
#
15-
path_to_BackupScript="/PATH/TO/BackupScript" # Path to BackupScript directory. Does not support Docker volume propagation!
16-
#
1715
system_id_name="HOSTNAME" # Name to identify your System in Snapshots.
1816
#
1917
schedule_update_Restic_and_Rclone="monthly: 1" # Schedule for the execution of the respective sub-process:
@@ -94,23 +92,40 @@ rclone_options="--log-level INFO"
9492

9593

9694

95+
96+
9797

9898

9999

100100
#################################################################################
101101
# Don't change the following lines #
102102
#################################################################################
103-
103+
path_to_BackupScript=$(dirname "$(dirname "$(readlink -f "$0")")")
104+
error_message="\
105+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ERROR !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n\
106+
\n\
107+
Project 'BackupsScript' was set up incorrectly.\n\
108+
Please check the setup by following the instructions.\n\
109+
This path '$path_to_BackupScript' should point to the root directory of BackupScript.\n\
110+
\n\
111+
Compare:\n\
112+
\n\
113+
└── BackupScript\n\
114+
├── Config\n\
115+
│ ├── DockerConfig\n\
116+
│ ├── FilterConfig\n\
117+
│ ├── RcloneConfig\n\
118+
│ └── RepositoryPassword\n\
119+
├── Executor\n\
120+
├── Jobs\n\
121+
│ └── YourBackupJob\n\
122+
└── SetupInstructions\n\
123+
\n\
124+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ERROR !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n\
125+
"
104126
if [ ! -f "$path_to_BackupScript/Executor/MainExec" ]; then
105-
echo "!!!!!!!!!!!!!!!!!!!!! ERROR !!!!!!!!!!!!!!!!!!!!!!"
106-
echo ""
107-
echo "Project "BackupsScripts" was set up incorrectly."
108-
echo "Please check the setup by following the instructions."
109-
echo "-> File '$path_to_BackupScript/Executor/MainExec' not found."
110-
echo ""
111-
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
127+
printf "%b" "$error_message"
112128
exit 1
113129
fi
114130
source $path_to_BackupScript/Executor/MainExec
115-
116131
#################################################################################

0 commit comments

Comments
 (0)