aboutsummaryrefslogtreecommitdiff
path: root/README.md
blob: ed6b363230a28c648ccc728e628b0f78b89e35ae (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# DRestic

<img src="logo.svg" width="120" markdown="1">

Automated encrypted backups to MEGA using restic.

## Setup

```sh
git clone https://github.com/casparvitch/drestic
cd drestic
make install-deps
make setup-user    # or setup-system for servers
```

Enter MEGA credentials and restic password when prompted. **Store the restic password safely.**

## Usage

```sh
make help          # see all commands
make status        # check backup status  
make backup-now    # run backup immediately
make snapshots     # list backups
```

**Recover files:**
```sh
mkdir ~/restore
# Replace with your repo path from ~/.config/restic/env
RESTIC_PASSWORD_FILE=~/.config/restic/password restic mount ~/restore --repo rclone:backup_remote:/drestic_backups_hostname
# Browse ~/restore/snapshots/latest/
umount ~/restore
```

## Configuration

Edit backup paths: `~/.config/restic/paths` (user) or `/etc/restic/paths` (system)
Edit excludes: `~/.config/restic/excludes`
Add notifications: `make update-gotify`

## Manual Checks

**Automated:** Metadata-only weekly checks (catches 95% of issues)

**Manual verification:**
```sh
# Quick metadata check (~50MB RAM, 1-2 min)
source ~/.config/restic/env && restic check --repo "$RESTIC_REPOSITORY" --password-file "$RESTIC_PASSWORD_FILE"

# Light data check (~200MB RAM, 5-15 min) 
source ~/.config/restic/env && restic check --repo "$RESTIC_REPOSITORY" --password-file "$RESTIC_PASSWORD_FILE" --read-data-subset 0.1%

# Heavy data check (~500MB+ RAM, 30+ min)
source ~/.config/restic/env && restic check --repo "$RESTIC_REPOSITORY" --password-file "$RESTIC_PASSWORD_FILE" --read-data-subset 1%
```

**From another machine:**
```sh
# Setup: install restic, rclone
rclone config create backup_remote mega user EMAIL pass PASSWORD
echo "PASSWORD" > ~/.restic_password && chmod 600 ~/.restic_password
restic check --repo rclone:backup_remote:/drestic_backups_HOSTNAME --password-file ~/.restic_password --read-data-subset 0.1%
```

**When:** Monthly 0.1% checks, quarterly 1% checks, or troubleshooting.

## Troubleshooting

```sh
make unlock-repo   # fix locked repository
make logs         # check recent logs
rclone ls backup_remote:  # test MEGA connection
```