Compare commits

...

3 Commits

2 changed files with 25 additions and 9 deletions

View File

@@ -30,6 +30,26 @@ Once that is done:
1. Reload the daemon `sudo systemctl daemon-reload`
1. Mount the folder `sudo mount -a`
### Automated Installation Script
This repository has an automated installation script that can be ran.
```bash
sudo su -c "bash <(wget -qO- https://git.housh.dev/homelab/backup/raw/branch/main/install.sh)" root
```
## Manual Installation
See [installation
script](https://git.housh.dev/homelab/backup/src/branch/main/install.sh).
### Setup the backup script
```bash
sudo wget "https://git.housh.dev/homelab/backup/raw/branch/main/docker-backup.sh" -O /usr/local/bin/docker-backup
sudo chmod +x /usr/local/bin/docker-backup
```
### Systemd Setup
Setup the systemd service and timer, so that backups are ran once a day @ 3 a.m.
@@ -44,13 +64,6 @@ sudo systemctl start backup.service
```
### Setup the backup script
1. Download the script `wget https://git.housh.dev/homelab/backup/raw/branch/main/docker-backup.sh`
1. Add any extra volumes to backup.
1. Make script executable `chmod +x docker-backup.sh`
1. Manually run the script `sudo ./docker-backup.sh`
## Restore
This repository also contains a restore script that can restore the stacks and

View File

@@ -6,6 +6,7 @@ bindir="/usr/local/bin"
# Remove backup service file if it exists and install the service file.
[ -f "$systemdir/backup.service" ] &&
systemctl stop backup.timer &&
systemctl stop backup.service &&
rm -f "$systemdir/backup.service"
wget "$baseurl/backup.service" -O "$systemdir/backup.service"
@@ -16,11 +17,13 @@ wget "$baseurl/backup.service" -O "$systemdir/backup.service"
# Remove the backup script file if it exists and install the backup script.
[ -f "$bindir/docker-backup" ] && rm -f "$bindir/docker-backup"
wget "$baseurl/docker-backup.sh" -O "$bindir/docker-backup"
wget "$baseurl/docker-backup.sh" -O "$bindir/docker-backup" &&
chmod +x "$bindir/docker-backup"
# Remove the restore script file if it exists and install the restore script.
[ -f "$bindir/docker-restore" ] && rm -f "$bindir/docker-restore"
wget "$baseurl/docker-restore.sh" -O "$bindir/docker-restore"
wget "$baseurl/docker-restore.sh" -O "$bindir/docker-restore" &&
chmod +x "$bindir/docker-restore"
# Start services
systemctl daemon-reload