Browse Source

backup dir stored in variable; eMail settings in variable

master
Hendrik Schutter 2 years ago
parent
commit
1710f9de8b
  1. 2
      .gitignore
  2. 21
      check_AutoBackup.sh

2
.gitignore vendored

@ -0,0 +1,2 @@
backups

21
check_AutoBackup.sh

@ -2,16 +2,21 @@
### GENERAL SETTINGS ###
DEBUG="true"
timestampFolder="index"
timestampFolder="index" #folder for reading timestamp
backupFolder="./backups" #directory that contains all repos
########################
### eMail ###
receiverEmail="admin@coptersicht.de"
senderEmail="autobackupwatchdog@coptersicht.de"
senderName="AutoBackup Watchdog"
########################
######### REPO SETTINGS #########
#repos_name[0]=" first backup repo"
#repos_directory[0]="first_repo"
#repos_interval[0]=21600 #sec
#repos_interval_tolerance[0]=10 #%
repos_name[0]=" first backup repo"
repos_directory[0]="first_repo"
repos_interval[0]=21600 #sec
repos_interval_tolerance[0]=10 #%
#repos_name[1]="second backup repo"
#repos_directory[1]="second_repo"
@ -31,6 +36,8 @@ fn_result="$(echo $(($1/86400))d $(($(($1 - $1/86400*86400))/3600))h:$(($(($1 -
echo "Starting AutoBackup Watchdog"
echo "Local time: $(date)"
cd $backupFolder #jump to backup folder that contains the repos
repo_count=$(("${#repos_name[@]}"))
echo "Repo Count: $repo_count"
repo_count=$(($repo_count-1))
@ -60,7 +67,7 @@ do
rm -f mail_content.txt
cat >> mail_content.txt <<EOL
Subject: AutoBackup Failure "${repos_name[i]}"
From: autobackupwatchdog@coptersicht.de
From: $senderEmail
Content-Type: text/html; charset="utf8
<head>
<style>
@ -105,7 +112,7 @@ Content-Type: text/html; charset="utf8
EOL
if [ "$DEBUG" = "false" ];
then
ssmtp -f"autobackupwatchdog@coptersicht.de" -F"AutoBackup Watchdog" $receiverEmail < mail_content.txt
ssmtp -f$senderEmail -F$senderName $receiverEmail < mail_content.txt
rm mail_content.txt
fi
fi

Loading…
Cancel
Save

Du besuchst diese Seite mit einem veralteten IPv4-Internetzugang. Möglicherweise treten in Zukunft Probleme mit der Erreichbarkeit und Performance auf. Bitte frage deinen Internetanbieter oder Netzwerkadministrator nach IPv6-Unterstützung.
You are visiting this site with an outdated IPv4 internet access. You may experience problems with accessibility and performance in the future. Please ask your ISP or network administrator for IPv6 support.
Weitere Infos | More Information
Klicke zum schließen | Click to close