feat: Adds systemd service and timer.

This commit is contained in:
2025-04-17 10:14:53 -04:00
parent 7bc1896316
commit dc2137bafe
3 changed files with 28 additions and 1 deletions

View File

@@ -1,3 +1,13 @@
# backup # backup
A script template to backup docker volumes on the servers. A script template to backup docker volumes on the servers.
## Usage
1. Download the script `wget https://git.housh.dev/homelab/backup/raw/branch/main/docker-backup.sh`
1. Edit the script to include services that need to be shut down, prior to
backup.
1. Add any extra volumes to backup.
1. Make script executable `chmod +x docker-backup.sh`
1. Run the script `sudo ./docker-backup.sh`

9
backup.service Normal file
View File

@@ -0,0 +1,9 @@
[Unit]
Description=Docker backup service
[Service]
Type=simple
ExecStart=/bin/bash -c '/home/michael/docker-backup.sh'
[Install]
WantedBy=default.target

8
backup.timer Normal file
View File

@@ -0,0 +1,8 @@
[Unit]
Description=Daily Backup Timer
[Timer]
OnCalendar=*-*-* 03:00:00
[Install]
WantedBy=timers.target