diff --git a/README.md b/README.md index f3df94d..3209713 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ The script monitors the backend of a restic backup. The bash script is executed * no restic authentication needed * multiple repos * individual interval for each repo -* custom email server via [mailsend](https://github.com/muquit/mailsend/blob/master/doc/examples.mediawiki) +* custom email server via [mailsend](https://github.com/muquit/mailsend-go/releases) * loud alarm buzzer via [FTDI_simple_alarm](https://git.mosad.xyz/localhorst/FTDI_simple_alarm) ## Planned Features diff --git a/check_AutoBackup.sh b/check_AutoBackup.sh index d2e9e09..988501d 100644 --- a/check_AutoBackup.sh +++ b/check_AutoBackup.sh @@ -1,27 +1,29 @@ -#! /bin/bash +-#! /bin/bash ### GENERAL SETTINGS ### -DEBUG="true" #don't send mail if in debug mode +DEBUG="false" #don't send mail if in debug mode timestampFolder="index" #folder for reading timestamp backupFolder="/mnt/hdd/backups/" #directory that contains all repos +backupServerName="Onsite Backup" #name of this backup server ######################## ### eMail ### -receiverEmail="localhorst@mosad.xyz" -senderEmail="______________@mosad.xyz" +receiverEmail="dummy@gmail.com" +senderEmail="dummy@gmail.com" +senderPassword="__PW_DB__" +mailServer="dummy@gmail.com" ######################## ######### REPO SETTINGS ######### -repos_name[0]="Name" -repos_directory[0]="path" +repos_name[0]="CDS Backup" +repos_directory[0]="cdsbackup" repos_interval[0]=21600 #sec repos_interval_tolerance[0]=10 #% -#repos_name[1]="another backup repo" -#repos_directory[1]="another_repo" +#repos_name[1]="SDS Backup" +#repos_directory[1]="sdsbackup" #repos_interval[1]=21600 #sec #repos_interval_tolerance[1]=10 #% -################################# #repos_name[2]="another backup repo" #repos_directory[2]="another_repo" @@ -80,7 +82,7 @@ do -

AutoBackup Failure

+

AutoBackup Failure on $backupServerName

Directory for the automatic backup for "${repos_name[i]}" not found

Local time: $(date)

@@ -88,14 +90,14 @@ do
EOL if [ "$DEBUG" = "false" ]; then - mailsend -f $senderEmail -t $receiverEmail -sub "AutoBackup Failure ${repos_name[i]}" -smtp mail.emailserver.science -port 587 -starttls -auth -user autobackupwatchdog@mosad.xyz -pass "__PW_DB__" -cs "utf-8" -mime-type "text/html" -msg-body "mail_content.txt" + mailsend-go -sub "AutoBackup Failure ${repos_name[i]} on $backupServerName" -smtp $mailServer -port 587 auth -user $senderEmail -pass $senderPassword -from $senderEmail -to $receiverEmail body -file mail_content.txt rm mail_content.txt #/etc/init.d/alarm start fi @@ -144,7 +146,7 @@ EOL -

AutoBackup Failure

+

AutoBackup Failure on $backupServerName

Overdue for the automatic backup for "${repos_name[i]}"

Local time: $(date)

@@ -155,16 +157,15 @@ EOL
EOL if [ "$DEBUG" = "false" ]; then - mailsend -f $senderEmail -t $receiverEmail -sub "AutoBackup Failure ${repos_name[i]}" -smtp mail.emailserver.science -port 587 -starttls -auth -user autobackupwatchdog@mosad.xyz -pass "__PW_DB__" -cs "utf-8" -mime-type "text/html" -msg-body "mail_content.txt" + mailsend-go -sub "AutoBackup Failure ${repos_name[i]} on $backupServerName" -smtp $mailServer -port 587 auth -user $senderEmail -pass $senderPassword -from $senderEmail -to $receiverEmail body -file mail_content.txt rm mail_content.txt - #/etc/init.d/alarm start fi fi done