2020-09-30 18:19:49 +02:00
|
|
|
# Restic repos:
|
2020-05-16 11:47:54 +02:00
|
|
|
|
2020-12-26 11:46:04 +01:00
|
|
|
## Local backups
|
|
|
|
|
2020-12-28 19:42:20 +01:00
|
|
|
### arco-pc-backup home
|
|
|
|
There is currently a problem in go that makes this command fail. Run the following command before retrying: `export GODEBUG=asyncpreemptoff=1`
|
2020-12-26 11:46:04 +01:00
|
|
|
```
|
|
|
|
restic init --repo /mnt/backups/arco-pc/home/marc
|
|
|
|
```
|
|
|
|
```
|
|
|
|
restic -r /mnt/backups/arco-pc/home/marc backup --verbose "/home/marc/" --exclude-file=/home/marc/GitProjects/config/Dokumente/home-exclude.txt
|
|
|
|
```
|
|
|
|
```
|
|
|
|
restic -r /mnt/backups/arco-pc/home/marc snapshots
|
|
|
|
```
|
|
|
|
```
|
|
|
|
restic -r /mnt/backups/arco-pc/home/marc restore --target "/home/marc" (snapshot)
|
|
|
|
```
|
|
|
|
|
2020-09-30 18:19:49 +02:00
|
|
|
## B2 backups
|
2020-09-30 18:27:21 +02:00
|
|
|
```bash
|
2020-10-09 21:26:40 +02:00
|
|
|
export B2_ACCOUNT_ID=
|
2020-09-30 18:27:21 +02:00
|
|
|
```
|
|
|
|
```bash
|
2020-10-09 21:26:40 +02:00
|
|
|
export B2_ACCOUNT_KEY=
|
2020-09-30 18:27:21 +02:00
|
|
|
```
|
2020-06-03 18:20:39 +02:00
|
|
|
|
2021-02-22 22:08:21 +01:00
|
|
|
### Generalised version
|
|
|
|
|
|
|
|
#### Initialise repository
|
|
|
|
`restic -r b2:(bucket):(path) init`
|
|
|
|
|
|
|
|
#### Create backup
|
|
|
|
`restic -r b2:(bucket):(path) backup --verbose "(path)" --exclude-file=(exclude file)`
|
|
|
|
|
|
|
|
#### Show snapshots
|
|
|
|
`restic -r b2:(bucket):(path) snapshots`
|
|
|
|
|
|
|
|
#### Restore snapshot
|
|
|
|
`restic -r b2:(bucket):(path) restore --target "(path)" (snapshot)`
|
|
|
|
|
|
|
|
#### Remove Snapshots
|
|
|
|
Only keep last X snapshots. Use "-n" to do a dry run
|
|
|
|
Does not remove data, just links
|
|
|
|
`restic -r b2:(bucket):(path) forget -l (X)`
|
|
|
|
|
|
|
|
Clean up unreferenced data. "-n" for dry run
|
|
|
|
`restic -r b2:(bucket):(path) prune`
|
|
|
|
|
|
|
|
|
2020-09-30 18:27:21 +02:00
|
|
|
### arco-pc-backup home
|
|
|
|
```bash
|
2020-05-31 13:10:45 +02:00
|
|
|
restic -r b2:arco-pc-backup:/home/marc init
|
2020-09-30 18:27:21 +02:00
|
|
|
```
|
|
|
|
```bash
|
2020-11-13 18:25:40 +01:00
|
|
|
restic -r b2:arco-pc-backup:/home/marc backup --verbose "/home/marc/" --exclude-file=/home/marc/GitProjects/config/Dokumente/home-exclude.txt
|
2020-09-30 18:27:21 +02:00
|
|
|
```
|
|
|
|
```bash
|
2020-06-03 18:20:39 +02:00
|
|
|
restic -r b2:arco-pc-backup:/home/marc snapshots
|
2020-09-30 18:27:21 +02:00
|
|
|
```
|
|
|
|
```bash
|
2020-12-26 11:46:04 +01:00
|
|
|
restic -r b2:arco-pc-backup:/home/marc restore --target "/home/marc/" (snapshot)
|
2020-09-30 18:27:21 +02:00
|
|
|
```
|
|
|
|
|
2021-01-13 10:45:37 +01:00
|
|
|
### arco-pc-backup 3tb toshiba
|
2020-09-30 18:27:21 +02:00
|
|
|
```
|
2021-01-13 10:45:37 +01:00
|
|
|
restic -r b2:arco-pc-backup:/mnt/harddrive init
|
2020-09-30 18:27:21 +02:00
|
|
|
```
|
|
|
|
```
|
2021-02-22 21:47:45 +01:00
|
|
|
restic -r b2:arco-pc-backup:/mnt/harddrive backup --verbose "/mnt/storage" --exclude="/mnt/storage/.Trash-1000" --exclude="/mnt/storage/MediaLibrary/Handbrake/" --exclude="/mnt/storage/SteamLibrary" --limit-upload=2048
|
2020-09-30 18:27:21 +02:00
|
|
|
```
|
|
|
|
```
|
2021-01-13 10:45:37 +01:00
|
|
|
restic -r b2:arco-pc-backup:/mnt/harddrive snapshots
|
2020-09-30 18:27:21 +02:00
|
|
|
```
|
|
|
|
```
|
2021-02-03 08:22:21 +01:00
|
|
|
restic -r b2:arco-pc-backup:/mnt/harddrive restore --target "/mnt/storage" (snapshot)
|
2020-09-30 18:27:21 +02:00
|
|
|
```
|
2020-06-28 23:05:36 +02:00
|
|
|
|
2021-02-09 20:15:53 +01:00
|
|
|
### hydra-server-backup /etc/nginx
|
|
|
|
```bash
|
|
|
|
restic -r b2:hydra-server-backup:/etc/nginx init
|
|
|
|
```
|
|
|
|
```bash
|
|
|
|
restic -r b2:hydra-server-backup:/etc/nginx backup --verbose "/etc/nginx"
|
|
|
|
```
|
|
|
|
```bash
|
|
|
|
restic -r b2:hydra-server-backup:/etc/nginx snapshots
|
|
|
|
```
|
|
|
|
```bash
|
|
|
|
restic -r b2:hydra-server-backup:/etc/nginx restore --target "/etc/nginx" <snapshot>
|
|
|
|
```
|
2020-06-09 18:13:07 +02:00
|
|
|
|
2021-02-09 20:15:53 +01:00
|
|
|
### realstickman-xyz-backup root
|
2020-09-30 18:27:21 +02:00
|
|
|
```bash
|
2020-07-17 11:24:37 +02:00
|
|
|
restic -r b2:realstickman-xyz-backup:root init
|
2020-09-30 18:27:21 +02:00
|
|
|
```
|
|
|
|
```bash
|
2020-07-17 11:24:37 +02:00
|
|
|
restic -r b2:realstickman-xyz-backup:root backup --verbose "/root"
|
2020-09-30 18:27:21 +02:00
|
|
|
```
|
|
|
|
```bash
|
2020-07-17 11:24:37 +02:00
|
|
|
restic -r b2:realstickman-xyz-backup:root snapshots
|
2020-09-30 18:27:21 +02:00
|
|
|
```
|
|
|
|
```bash
|
2020-08-10 21:49:48 +02:00
|
|
|
restic -r b2:realstickman-xyz-backup:root restore --target "/root" <snapshot>
|
2020-09-30 18:27:21 +02:00
|
|
|
```
|
2020-07-17 11:24:37 +02:00
|
|
|
|
2020-09-30 18:27:21 +02:00
|
|
|
### realstickman-xyz-backup etc
|
|
|
|
```bash
|
2020-07-17 11:24:37 +02:00
|
|
|
restic -r b2:realstickman-xyz-backup:etc init
|
2020-09-30 18:27:21 +02:00
|
|
|
```
|
|
|
|
```bash
|
2020-07-17 11:24:37 +02:00
|
|
|
restic -r b2:realstickman-xyz-backup:etc backup --verbose "/etc"
|
2020-09-30 18:27:21 +02:00
|
|
|
```
|
|
|
|
```bash
|
2020-08-10 21:49:48 +02:00
|
|
|
restic -r b2:realstickman-xyz-backup:etc snapshots
|
2020-09-30 18:27:21 +02:00
|
|
|
```
|
|
|
|
```bash
|
2020-09-30 18:17:22 +02:00
|
|
|
restic -r b2:realstickman-xyz-backup:etc restore --target "/etc" <snapshot>
|
2020-09-30 18:27:21 +02:00
|
|
|
```
|
2021-01-15 20:06:08 +01:00
|
|
|
|
|
|
|
### nextcloud-realstickman-backup var
|
|
|
|
```
|
|
|
|
restic -r b2:nextcloud-realstickman-backup:var init
|
|
|
|
```
|
|
|
|
```
|
|
|
|
restic -r b2:nextcloud-realstickman-backup:var backup --verbose "/var"
|
|
|
|
```
|
|
|
|
```
|
|
|
|
restic -r b2:nextcloud-realstickman-backup:var snapshots
|
|
|
|
```
|
|
|
|
```
|
|
|
|
restic -r b2:nextcloud-realstickman-backup:var restore --target "/var" <snapshot>
|
|
|
|
```
|