Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 22 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,39 +36,39 @@ For those familiar with setting up backup scripts, here is a fast track to get y

1. **Download files**

```sh
mkdir -p /root/scripts/backup && cd /root/scripts/backup
curl -LO https://raw.githubusercontent.com/buildplan/restic-backup-script/refs/heads/main/restic-backup.sh
curl -LO https://raw.githubusercontent.com/buildplan/restic-backup-script/refs/heads/main/restic-backup.conf
curl -LO https://raw.githubusercontent.com/buildplan/restic-backup-script/refs/heads/main/restic-excludes.txt
chmod +x restic-backup.sh
```
```sh
mkdir -p /root/scripts/backup && cd /root/scripts/backup
curl -LO https://raw.githubusercontent.com/buildplan/restic-backup-script/refs/heads/main/restic-backup.sh
curl -LO https://raw.githubusercontent.com/buildplan/restic-backup-script/refs/heads/main/restic-backup.conf
curl -LO https://raw.githubusercontent.com/buildplan/restic-backup-script/refs/heads/main/restic-excludes.txt
chmod +x restic-backup.sh
```

2. **Edit configuration**

- Update `restic-backup.conf` with repository details, backup sources, and password file.
- Secure it: `chmod 600 restic-backup.conf`
- Update `restic-backup.conf` with repository details, backup sources, and password file.
- Secure it: `chmod 600 restic-backup.conf`

3. **Create password and initialize repository**

```sh
# Create the password file (use a strong, unique password)
echo 'your-very-secure-password' | sudo tee /root/.restic-password
sudo chmod 400 /root/.restic-password
```sh
# Create the password file (use a strong, unique password)
echo 'your-very-secure-password' | sudo tee /root/.restic-password
sudo chmod 400 /root/.restic-password

# Initialize the repository
sudo ./restic-backup.sh --init
```
# Initialize the repository
sudo ./restic-backup.sh --init
```

4. **First backup and schedule**

```sh
# Run the first backup with verbose output
sudo ./restic-backup.sh --verbose
```sh
# Run the first backup with verbose output
sudo ./restic-backup.sh --verbose

# Set up a recurring schedule via wizard (systemd or cron)
sudo ./restic-backup.sh --install-scheduler
```
# Set up a recurring schedule via wizard (systemd or cron)
sudo ./restic-backup.sh --install-scheduler
```

> Default log: `/var/log/restic-backup.log`

Expand Down Expand Up @@ -532,9 +532,6 @@ If you prefer to manage the schedule manually instead of using the wizard, you c
2. Add the following lines to schedule your backups and maintenance.

```crontab
# Define a safe PATH that includes the location of restic
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

# Run the Restic backup every day at 3:00 AM
0 3 * * * /root/scripts/backup/restic-backup.sh > /dev/null 2>&1

Expand Down
5 changes: 3 additions & 2 deletions restic-backup.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
#!/usr/bin/env bash

# =================================================================
# Restic Backup Script v0.38.2 - 2025.10.08
# Restic Backup Script v0.38.3 - 2025.10.18
# =================================================================

export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
set -euo pipefail
umask 077

# --- Script Constants ---
SCRIPT_VERSION="0.38.2"
SCRIPT_VERSION="0.38.3"
SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)
CONFIG_FILE="${SCRIPT_DIR}/restic-backup.conf"
LOCK_FILE="/tmp/restic-backup.lock"
Expand Down
2 changes: 1 addition & 1 deletion restic-backup.sh.sha256
Original file line number Diff line number Diff line change
@@ -1 +1 @@
84a7b2750793953abf94aea82971596fedad1cb4382f1ad6264bae3ba66ecc65 restic-backup.sh
568618563ca890afec48f97cb9bc88fc36d2735cd4d031951713ea4bdd8e4806 restic-backup.sh