Restic-Backend-Watchdog/README.md

54 lines
1.9 KiB
Markdown
Raw Normal View History

2020-04-24 22:51:11 +02:00
# Restic-Backend-Watchdog
Watchdog for restic backup that are automatic triggered via an interval
**TLDR:** Bash script that emails you if your restic backup interval is overdue.
2020-04-25 11:26:37 +02:00
![Screenshot of email](https://git.mosad.xyz/CopterSicht/Restic-Backend-Watchdog/raw/branch/master/Screenshot_20200425_112352.png)
## How does it work?
2020-04-25 11:26:37 +02:00
The script monitors the backend of a restic backup. The bash script is executed via cronjob or a systemd-timer periodically. The user sets an interval for each restic repo (e.g. your laptop-backup). This is the same interval as the one that triggers the automatic backup from your device. If your automatic backup failed (e.g. no Internet), there will be no changes in den repo. The script will notice that and emails you.
## Features
* runs just with bash
* no restic authentication needed
* multiple repos
* individual interval for each repo
2022-02-18 11:38:02 +01:00
* custom email server via [mailsend](https://github.com/muquit/mailsend/blob/master/doc/examples.mediawiki)
2020-05-12 09:22:26 +02:00
* loud alarm buzzer via [FTDI_simple_alarm](https://git.mosad.xyz/localhorst/FTDI_simple_alarm)
## Planned Features
* Able to determine a failed restic repo task from a successful task
## Installation
2020-04-25 11:21:51 +02:00
#### 1. download the check_AutoBackup.sh
#### 2. chmod +x check_AutoBackup.sh
2022-02-18 11:38:02 +01:00
#### 3. install mailsend
2020-04-25 11:21:51 +02:00
2022-02-18 11:38:02 +01:00
#### 4. edit settings in check_AutoBackup.sh
2020-04-25 11:21:51 +02:00
```
2020-04-25 11:21:51 +02:00
DEBUG="true" #true --> dont send email
timestampFolder="index" #folder for reading timestamp
backupFolder="./backups" #directory that contains all repos
2020-04-25 11:21:51 +02:00
receiverEmail="mailuser@maildomain.tld"
senderEmail="mailuser@maildomain.tld"
```
2020-04-25 11:21:51 +02:00
2022-02-18 11:38:02 +01:00
#### 5. edit repo settings in check_AutoBackup.sh
2020-04-25 11:21:51 +02:00
```
repos_name[0]=" first backup repo"
2020-04-25 11:21:51 +02:00
repos_directory[0]="first_repo" #repo in backupFolder
repos_interval[0]=21600 #sec
repos_interval_tolerance[0]=10 #%
```
2022-02-18 11:38:02 +01:00
#### 6. install crontab or systemd-timer
2020-05-12 09:22:26 +02:00
2022-02-18 11:38:02 +01:00
#### 7. optional install FTDI simple alarm
2020-05-12 09:22:26 +02:00
[FTDI_simple_alarm](https://git.mosad.xyz/localhorst/FTDI_simple_alarm)
2022-02-18 11:38:02 +01:00
uncomment line 167 in check_AutoBackup.sh