autorestic/docs/pages/quick.md

85 lines
1.9 KiB
Markdown
Raw Permalink Normal View History

2020-05-17 14:52:30 +02:00
# 🚀 Quickstart
## Installation
```bash
2022-10-18 16:23:27 +02:00
wget -qO - https://raw.githubusercontent.com/cupcakearmy/autorestic/master/install.sh | bash
2020-05-17 14:52:30 +02:00
```
2021-04-28 13:44:20 +02:00
See [installation](/installation) for alternative options.
2020-05-17 14:52:30 +02:00
## Write a simple config file
```bash
2021-04-27 01:22:32 +02:00
vim ~/.autorestic.yml
2020-05-17 14:52:30 +02:00
```
For a quick overview:
- `locations` can be seen as the inputs and `backends` the output where the data is stored and backed up.
2021-04-21 09:34:01 +02:00
- One `location` can have one or multiple `backends` for redundancy.
2020-06-28 22:48:00 +02:00
- One `backend` can also be the target for multiple `locations`.
2021-04-16 00:26:57 +02:00
> **⚠️ WARNING ⚠️**
>
> Note that the data is automatically encrypted on the server. The key will be generated and added to your config file. Every backend will have a separate key. **You should keep a copy of the keys or config file somewhere in case your server dies**. Otherwise DATA IS LOST!
2020-05-17 14:52:30 +02:00
```yaml | .autorestic.yml
2021-11-21 21:06:25 +01:00
version: 2
2020-05-17 14:52:30 +02:00
locations:
2021-04-21 09:27:35 +02:00
home:
2021-11-21 21:06:25 +01:00
from: /home
# Or multiple
# from:
# - /foo
# - /bar
2020-05-17 14:52:30 +02:00
to: remote
2021-04-21 09:27:35 +02:00
important:
2020-05-17 14:52:30 +02:00
from: /path/to/important/stuff
to:
- remote
- hdd
backends:
2021-04-27 18:35:32 +02:00
remote:
2020-05-17 14:52:30 +02:00
type: s3
path: 's3.amazonaws.com/bucket_name'
2021-04-16 00:26:57 +02:00
key: some-random-password-198rc79r8y1029c8yfewj8f1u0ef87yh198uoieufy
2021-04-21 09:27:35 +02:00
env:
AWS_ACCESS_KEY_ID: account_id
AWS_SECRET_ACCESS_KEY: account_key
2020-05-17 14:52:30 +02:00
2021-04-27 18:35:32 +02:00
hdd:
2020-05-17 14:52:30 +02:00
type: local
path: /mnt/my_external_storage
2021-04-16 00:26:57 +02:00
key: 'if not key is set it will be generated for you'
2020-05-17 14:52:30 +02:00
```
2020-06-28 22:48:00 +02:00
## Check
2020-05-17 14:52:30 +02:00
```bash
2021-04-25 11:19:39 +02:00
autorestic check
2020-05-17 14:52:30 +02:00
```
This checks if the config file has any issues. If this is the first time this can take longer as autorestic will setup the backends.
2020-06-28 22:48:00 +02:00
Now is good time to **backup the config**. After you run autorestic at least once we will add the generated encryption keys to the config.
2020-05-17 14:52:30 +02:00
## Backup
```bash
autorestic backup -a
```
This will do a backup of all locations.
## Restore
```bash
autorestic restore -l home --from hdd --to /path/where/to/restore
```
This will restore the location `home` from the backend `hdd` to the given path.