47 lines
1.1 KiB
Markdown
47 lines
1.1 KiB
Markdown
# Restic Scripts
|
|
|
|
## Environment Variables
|
|
|
|
Recommended to put these in the relevant `~/.bashrc` file
|
|
|
|
| Env Variable | Description |
|
|
|---------------------|--------------------------------------------------------------------------------------------|
|
|
| `BACKUP_DIR` | Directory to back up |
|
|
| `RESTIC_REPOSITORY` | Directory for the restic repository. This is usually on a mount point made from Proxmox |
|
|
| `RESTIC_PASSWORD` | Password for the restic repository |
|
|
| `LOKI_URL` | Push URL for Loki. Should include the port and end with something like `/loki/api/v1/push` |
|
|
|
|
## Usage
|
|
|
|
### Python
|
|
|
|
```shell
|
|
python -m restic.snapshots
|
|
```
|
|
|
|
```shell
|
|
python -m restic.backup
|
|
```
|
|
|
|
```shell
|
|
python -m restic.prune
|
|
```
|
|
|
|
### Shell Scripts
|
|
|
|
```shell
|
|
./restic_command.sh snapshots
|
|
```
|
|
|
|
```shell
|
|
./restic_backup.sh --tag manual
|
|
```
|
|
|
|
```shell
|
|
./restic_command.sh forget --keep-last 1
|
|
```
|
|
|
|
```shell
|
|
./restic_command.sh restore
|
|
```
|