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-23 08:07:52 +01:00
|
|
|
restic -r b2:arco-pc-backup:/mnt/harddrive backup --verbose "/mnt/storage" --exclude-file=/home/marc/GitProjects/config/Dokumente/storage-exclude.txt --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-03-03 21:31:12 +01:00
|
|
|
### hydra-server-backup var
|
2021-02-09 20:15:53 +01:00
|
|
|
```
|
2021-03-03 21:31:12 +01:00
|
|
|
restic -r b2:hydra-server-backup:var init
|
2021-02-09 20:15:53 +01:00
|
|
|
```
|
|
|
|
```
|
2021-03-03 21:31:12 +01:00
|
|
|
restic -r b2:hydra-server-backup:var backup --verbose "/var"
|
2021-02-09 20:15:53 +01:00
|
|
|
```
|
2020-09-30 18:27:21 +02:00
|
|
|
```
|
2021-03-03 21:31:12 +01:00
|
|
|
restic -r b2:hydra-server-backup:var snapshots
|
2020-09-30 18:27:21 +02:00
|
|
|
```
|
|
|
|
```
|
2021-03-03 21:31:12 +01:00
|
|
|
restic -r b2:hydra-server-backup:var restore --target "/var" <snapshot>
|
2020-09-30 18:27:21 +02:00
|
|
|
```
|
2021-01-15 20:06:08 +01:00
|
|
|
|
2021-03-03 21:31:12 +01:00
|
|
|
### hydra-server-backup etc
|
2021-01-15 20:06:08 +01:00
|
|
|
```
|
2021-03-03 21:31:12 +01:00
|
|
|
restic -r b2:hydra-server-backup:etc init
|
2021-01-15 20:06:08 +01:00
|
|
|
```
|
|
|
|
```
|
2021-03-03 21:31:12 +01:00
|
|
|
restic -r b2:hydra-server-backup:etc backup --verbose "/etc"
|
2021-01-15 20:06:08 +01:00
|
|
|
```
|
|
|
|
```
|
2021-03-03 21:31:12 +01:00
|
|
|
restic -r b2:hydra-server-backup:etc snapshots
|
2021-01-15 20:06:08 +01:00
|
|
|
```
|
|
|
|
```
|
2021-03-03 21:31:12 +01:00
|
|
|
restic -r b2:hydra-server-backup:etc restore --target "/etc" <snapshot>
|
2021-01-15 20:06:08 +01:00
|
|
|
```
|