1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/borg_ynh.git synced 2024-09-03 18:16:05 +02:00

Small typos

This commit is contained in:
ericgaspar 2020-12-19 11:42:47 +01:00
parent 50643e260c
commit 43a7e3e69f
No known key found for this signature in database
GPG key ID: 574F281483054D44

View file

@ -5,27 +5,26 @@
[![Integration level](https://dash.yunohost.org/integration/borg.svg)](https://dash.yunohost.org/appci/app/borg)
[![GitHub license](https://img.shields.io/badge/license-GPLv3-blue.svg?style=flat)](https://raw.githubusercontent.com/YunoHost-Apps/borg_ynh/master/LICENSE)
[![GitHub issues](https://img.shields.io/github/issues/YunoHost-Apps/borg_ynh.svg?style=flat)](https://github.com/YunoHost-Apps/borg_ynh/issues)
[![Install Borg with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=borg)
A [Borg](https://borgbackup.readthedocs.io/en/stable/index.html#what-is-borgbackup) implementation to backup a YunoHost server. This is the Borg Backup App to be installed on a server to backup. It works together with a [Borg Server App](https://github.com/YunoHost-Apps/borgserver_ynh) installed on a host server.
## How to backup your server with this app ?
## How to backup your server with this app?
You want to backup a critical "guest" Server A onto a remote "host" Server B, you need:
* Domain name of server B: ``host.serverb``
* Name of the server B SSH user (to be created by ``borgserver``) for connection from Server A: ``borgservera``
* Domain name of server B: `host.serverb`
* Name of the server B SSH user (to be created by `borgserver`) for connection from Server A: `borgservera`
* **Strong passphrase** to encrypt your backups on host Server B. And to **restore your backups**!!
* IDs of YunoHost apps you want to backup
* Regular time schedule for your backups, see below
* Install Borg Backup App (``borg``) on guest Server A
* Install Borg Server App (``borgserver``) on host Server B
* Install Borg Backup App (`borg`) on guest Server A
* Install Borg Server App (`borgserver`) on host Server B
* Save the passphrase in another place than your server. Without the passphrase, you won't be able to restore data.
You should received an email after the first backup succeeded.
### Set up Borg Backup App on guest Server A
Firstly, set up the Borg Backup App (``borg``) on the guest Server A you want to backup:
Firstly, set up the Borg Backup App (`borg`) on the guest Server A you want to backup:
```
$ yunohost app install borg
Indicate the domain name of server B where to upload backups: host.serverb
@ -38,7 +37,7 @@ Indicate the backup frequency (see systemd OnCalendar format) (default: Daily):
```
#### Syntax to define a backup time schedule
You can schedule regular backups at specific time. Only one regular time schedule is possible for one ``borg`` instance, see below for workaround. Some examples:
You can schedule regular backups at specific time. Only one regular time schedule is possible for one `borg` instance, see below for workaround. Some examples:
* Monthly :
* Weekly :
* Daily : Daily at midnight
@ -56,7 +55,7 @@ User: servera
Public key: ssh-ed25519 AAAA[...] root@guest.servera
```
This information is also sent by email to the admin of guest Server A.
If you don't find the mail and you don't see the message in the log bar you can find the SSH public key with this command:
If you don't find the email and you don't see the message in the log bar you can find the SSH public key with this command:
```
$ cat /root/.ssh/id_borg_ed25519.pub
ssh-ed25519 AAAA[...] root@guest.servera
@ -90,7 +89,7 @@ If you want to be sure to be able to restore your server, you should try to rest
You should at least:
* Keep your apps up to date (if apps are too old, they could be difficult to restore on a more recent recent version)
* Check regularly the presence of info.json and db.sql or dump.sql in your apps archives
* Check regularly the presence of `info.json` and `db.sql` or `dump.sql` in your apps archives
```
borg list ./::ARCHIVE_NAME | grep info.json
borg list ./::ARCHIVE_NAME | grep db.sql
@ -100,13 +99,13 @@ borg list ./::ARCHIVE_NAME | grep dump.sql
## How to restore a complete system
*For infos on restoring process, check [this yunohost forum thread](https://forum.yunohost.org/t/restoring-whole-yunohost-from-borg-backups/12705/3) and [that one](https://forum.yunohost.org/t/how-to-properly-backup-and-restore/12583/3), also [using borg with sshkeys](https://thisiscasperslife.wordpress.com/2017/11/28/using-borg-backup-across-ssh-with-sshkeys/), the [`borg extract` documentation](https://borgbackup.readthedocs.io/en/stable/usage/extract.html), and this [general tutorial on borg backup](https://practical-admin.com/blog/backups-using-borg/).*
*For infos on restoring process, check [this yunohost forum thread](https://forum.yunohost.org/t/restoring-whole-yunohost-from-borg-backups/12705/3) and [that one](https://forum.yunohost.org/t/how-to-properly-backup-and-restore/12583/3), also [using Borg with sshkeys](https://thisiscasperslife.wordpress.com/2017/11/28/using-borg-backup-across-ssh-with-sshkeys/), the [`borg extract` documentation](https://borgbackup.readthedocs.io/en/stable/usage/extract.html), and this [general tutorial on Borg Backup](https://practical-admin.com/blog/backups-using-borg/).*
In the following explanations:
- the server to backup/restore will be called: `yuno`
- the remote server that receives and store the back will be called: `rem`
- `rem` is accessible at the domain `rem.tld`
- the remote user on `rem` which owns the borg backups will be called `yurem`
- the remote user on `rem` which owns the Borg backups will be called `yurem`
- backup files will be stored in `rem` in the directory: `/home/yurem/backup`
@ -114,24 +113,24 @@ In the following explanations:
The idea here, if you need to restore a whole yunohost system is:
1. Install a new debian VM
2. Install yunohost in it the usual way
3. Go through yunohost postinstall (parameters you will supply are not crucial, as they will be replaced by the restore)
4. Install borg
1. Install a new Debian VM
2. Install YunoHost in it the usual way
3. Go through YunoHost postinstall (parameters you will supply are not crucial, as they will be replaced by the restore)
4. Install Borg
5. Setup `rem` to accept ssh connections from `yuno`
6. Use borg to import backups from `rem` to `yuno`
7. Restore borg backups with the `yunohost backup restore` command, first config, then data, then each app one at a time
8. Remove the borg app and restore it
6. Use Borg to import backups from `rem` to `yuno`
7. Restore Borg backups with the `yunohost backup restore` command, first config, then data, then each app one at a time
8. Remove the Borg app and restore it
### Make it possible for `yuno` to connect to `rem` with borg
### Make it possible for `yuno` to connect to `rem` with Borg
At this stage, we will assume that `yuno` is a freshly installed yunohost (based on buster in my case). You should also have performed the yunohost postinstall.
At this stage, we will assume that `yuno` is a freshly installed YunoHost (based on Buster in my case). You should also have performed the YunoHost postinstall.
If you don't want to restore the whole system, just some apps, you can skip some of the steps below.
#### Install the borg yunohost app in `yuno`
#### Install the Borg YunoHost app in `yuno`
The idea here is just to install borg, not in order to create backups, but only to use borg commands to import remote backups.
The idea here is just to install Borg, not in order to create backups, but only to use Borg commands to import remote backups.
So for example, you can install it doing the following:
```bash
@ -142,9 +141,9 @@ sudo yunohost app install borg -a "server=rem.tld&ssh_user=yurem&conf=0&data=0&a
In `yuno` you will need to get the ssh key that borg just created while installing: `sudo cat /root/.ssh/id_borg_ed25519.pub`, copy it to clipboard.
Connect via ssh to `rem`, go to `/home/yurem/.ssh/authorized_keys`, and past the borg public key you got at previous step.
Connect via ssh to `rem`, go to `/home/yurem/.ssh/authorized_keys`, and past the Borg public key you got at previous step.
Now to make sure this worked, you can try to ssh from `yuno` to `rem`.
Now to make sure this worked, you can try to SSH from `yuno` to `rem`.
In `yuno` : `ssh -i /root/.ssh/id_borg_ed25519 yurem@rem.tld` . If you can get into `rem` , without it prompting for a password, then you're good to continue :)
### Restore backups to `yuno`
@ -173,9 +172,9 @@ yunohost backup restore auto_BACKUP_NAME --system # for config and data backups
yunohost backup restore auto_BACKUP_NAME --apps # for other backups (=apps)
```
### And nextcloud? It's super heavy!!
### And Nextcloud? It's super heavy!!
For nextcloud, the best is probably to reimport the backup without the data. And to import the data manually.
For Nextcloud, the best is probably to reimport the backup without the data. And to import the data manually.
For that, you can do the following (as root):
@ -195,11 +194,11 @@ rm -r apps
yunohost backup restore auto_nextcloud_XX_XX_XX_XX:XX --apps
```
### Restore borg
### Restore Borg
Once you've restored the whole system, you will probably want to restore the borg app as well.
Once you've restored the whole system, you will probably want to restore the Borg app as well.
For that, remove the "dummy" borg you installed to do the restoration, and restore borg the same ways as for other apps:
For that, remove the "dummy" Borg you installed to do the restoration, and restore Borg the same ways as for other apps:
```bash
sudo yunohost app remove borg
@ -215,7 +214,7 @@ sudo yunohost backup restore auto_borg_XX_XX_XX_XX:XX --apps
[Get the storage space used by the backup repository on the host server](https://borgbackup.readthedocs.io/en/stable/usage/info.html)
``borg info /home/servera/backup``
### Backup Yunohost apps with different criticallity levels
### Backup YunoHost apps with different criticallity levels
If you want to backup your guest server:
* with different YunoHost apps