Files
Homelab/scripts/install_restic_backup.sh

29 lines
887 B
Bash
Executable File

#!/bin/bash
# install_restic_backup.sh - Install restic and configure systemd timer
set -euo pipefail
echo "Installing restic..."
sudo apt-get update
sudo apt-get install -y restic
echo "Making backup script executable..."
sudo chmod +x /workspace/homelab/scripts/backup_daily.sh
echo "Installing systemd service and timer..."
sudo cp /workspace/homelab/systemd/restic-backup.service /etc/systemd/system/
sudo cp /workspace/homelab/systemd/restic-backup.timer /etc/systemd/system/
echo "Reloading systemd daemon..."
sudo systemctl daemon-reload
echo "Enabling and starting timer..."
sudo systemctl enable restic-backup.timer
sudo systemctl start restic-backup.timer
echo "Checking timer status..."
sudo systemctl status restic-backup.timer
echo "Restic backup installation complete."
echo "Remember to update /workspace/homelab/scripts/backup_daily.sh with your B2 credentials."