mirror of
https://github.com/YunoHost-Apps/borg_ynh.git
synced 2024-09-03 18:16:05 +02:00
commit
3331ddc489
3 changed files with 110 additions and 9 deletions
|
@ -5,4 +5,5 @@
|
|||
- [Irakurri README euskaraz](README_eu.md)
|
||||
- [Lire le README en français](README_fr.md)
|
||||
- [Le o README en galego](README_gl.md)
|
||||
- [Baca README dalam bahasa bahasa Indonesia](README_id.md)
|
||||
- [阅读中文(简体)的 README](README_zh_Hans.md)
|
||||
|
|
56
README_id.md
Normal file
56
README_id.md
Normal file
|
@ -0,0 +1,56 @@
|
|||
<!--
|
||||
N.B.: README ini dibuat secara otomatis oleh <https://github.com/YunoHost/apps/tree/master/tools/readme_generator>
|
||||
Ini TIDAK boleh diedit dengan tangan.
|
||||
-->
|
||||
|
||||
# Borg Backup untuk YunoHost
|
||||
|
||||
[](https://ci-apps.yunohost.org/ci/apps/borg/)  
|
||||
|
||||
[](https://install-app.yunohost.org/?app=borg)
|
||||
|
||||
*[Baca README ini dengan bahasa yang lain.](./ALL_README.md)*
|
||||
|
||||
> *Paket ini memperbolehkan Anda untuk memasang Borg Backup secara cepat dan mudah pada server YunoHost.*
|
||||
> *Bila Anda tidak mempunyai YunoHost, silakan berkonsultasi dengan [panduan](https://yunohost.org/install) untuk mempelajari bagaimana untuk memasangnya.*
|
||||
|
||||
## Ringkasan
|
||||
|
||||
A [Borg](https://borgbackup.readthedocs.io/en/stable/index.html#what-is-borgbackup) integration to backup your YunoHost server to another remote server (e.g. one of your friends).
|
||||
|
||||
This app is the "client" part, meant to be installed on the server to be backed up. It works in combination with the [borg server app](https://apps.yunohost.org/app/borgserver) installed on a diffent machine.
|
||||
|
||||
### Features
|
||||
|
||||
- Backup on a remote machine, in combination with the [borg server app](https://apps.yunohost.org/app/borgserver)
|
||||
- ... or on a [commercial borg service](https://www.borgbackup.org/support/commercial.html)
|
||||
- Backups are encrypted (the remote server can't read the content) and deduplicated (optimize space)
|
||||
- Backups are ran automatically, you can choose when and at which frequency
|
||||
- You can choose what apps are backuped
|
||||
- Receive email alerts if the backup fails (the [borg server app](https://apps.yunohost.org/app/borgserver) also checks that new content arrives and send an email to your friend otherwise)
|
||||
|
||||
### Install procedure
|
||||
|
||||
Maybe counter-intuitively, you should *first* install this app (`borg_ynh`) and *then* (`borgserver_ynh`) on the other machine. In fact, at the end of the install of `borg_ynh`, you will be provided with the info, in particular the SSH public key, to be used to setup `borgserver_ynh` on the other machine.
|
||||
|
||||
|
||||
**Versi terkirim:** 1.2.8~ynh2
|
||||
## Dokumentasi dan sumber daya
|
||||
|
||||
- Website aplikasi resmi: <https://borgbackup.readthedocs.io>
|
||||
- Gudang YunoHost: <https://apps.yunohost.org/app/borg>
|
||||
- Laporkan bug: <https://github.com/YunoHost-Apps/borg_ynh/issues>
|
||||
|
||||
## Info developer
|
||||
|
||||
Silakan kirim pull request ke [`testing` branch](https://github.com/YunoHost-Apps/borg_ynh/tree/testing).
|
||||
|
||||
Untuk mencoba branch `testing`, silakan dilanjutkan seperti:
|
||||
|
||||
```bash
|
||||
sudo yunohost app install https://github.com/YunoHost-Apps/borg_ynh/tree/testing --debug
|
||||
atau
|
||||
sudo yunohost app upgrade borg -u https://github.com/YunoHost-Apps/borg_ynh/tree/testing --debug
|
||||
```
|
||||
|
||||
**Info lebih lanjut mengenai pemaketan aplikasi:** <https://yunohost.org/packaging_apps>
|
62
doc/ADMIN.md
62
doc/ADMIN.md
|
@ -1,3 +1,7 @@
|
|||
## Reminder regarding the passphrase
|
||||
|
||||
The passphrase is the only way to decrypt your backups. You should make sure to keep it safe in some place "outside" your server to cover the scenario where your server is destroyed for some reason.
|
||||
|
||||
## Testing that backup work as expected
|
||||
|
||||
At this step your backup should run at the scheduled time. Note that the first backup can take very long, as much data has to be copied through ssh. Following backups are incremental: only newly generated data since last backup will be copied.
|
||||
|
@ -10,19 +14,59 @@ systemctl start borg
|
|||
|
||||
Once the backup completes, you can check that a backup is listed in the webadmin > Applications > Borg > 'Last backups list'.
|
||||
|
||||
## Check regularly your backup
|
||||
## Manually running `borg` commands
|
||||
|
||||
If you want to be sure to be able to restore your server, you should try to restore regularly the archives. But this process is quite time consumming.
|
||||
The config panel has a "Last backup list" that allow to have quick look at the recently created backup archives.
|
||||
|
||||
You should at least:
|
||||
However, you may want to manually inspect that the backups are indeed made regularly and contain the expected content.
|
||||
|
||||
- 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
|
||||
First, prepare the environment with the appropriate borg variables, etc:
|
||||
|
||||
```bash
|
||||
borg list ./::ARCHIVE_NAME | grep info.json
|
||||
borg list ./::ARCHIVE_NAME | grep db.sql
|
||||
borg list ./::ARCHIVE_NAME | grep dump.sql
|
||||
app=borg
|
||||
PATH="/var/www/$app/venv/bin/:$PATH"
|
||||
export BORG_PASSPHRASE="$(sudo yunohost app setting $app passphrase)"
|
||||
export BORG_RSH="ssh -i /root/.ssh/id_${app}_ed25519 -oStrictHostKeyChecking=yes"
|
||||
repository="$(sudo yunohost app setting $app repository)"
|
||||
```
|
||||
|
||||
- Be sure to have your passphrase available even if your server is completely broken
|
||||
Then run for example:
|
||||
|
||||
- List archives: `borg list "$repository" | less`
|
||||
- List files from a specific archive: `borg list "$repository::ARCHIVE_NAME" | less`
|
||||
- View archive info: `borg info "$repository::ARCHIVE_NAME"`
|
||||
- Verify data integrity: `borg info "$repository::ARCHIVE_NAME" --verify-data`
|
||||
|
||||
## Restoring archives from Borg
|
||||
|
||||
A borg "archive" can be exported to a `.tar` which can then be restored using the classic Yunohost backup restore workflow:
|
||||
|
||||
**NB: this command assumes that you prepared the environment just like in the previous section**
|
||||
|
||||
```bash
|
||||
borg export-tar "$repository::ARCHIVE_NAME" /home/yunohost/archives/ARCHIVE_NAME.tar
|
||||
```
|
||||
|
||||
Then restore using the classic workflow:
|
||||
- from the command line: `yunohost backup restore ARCHIVE_NAME`
|
||||
- or in the webadmin > Backups
|
||||
|
||||
### Restoring the "source+config" of the app, and its data separately
|
||||
|
||||
For apps containing a large amount of data, restoring *everything* all at once is not practical because of the space and time it will take. Instead you may want to first restore the "core" (the source, configuration, etc) of the app, - and *then* the data.
|
||||
|
||||
First, borg can export a .tar archive but ignore the path corresponding to the app's data. For example, to export a tar archive for Nextcloud, but without its data:
|
||||
|
||||
```bash
|
||||
borg export-tar --exclude apps/nextcloud/backup/home/yunohost.app "$repository::ARCHIVE_NAME" /home/yunohost.backup/archives/ARCHIVE_NAME.tar
|
||||
yunohost backup restore ARCHIVE_NAME
|
||||
```
|
||||
|
||||
Then extract Nextcloud's data directly into the right location, **without** going through the classic YunoHost backup restore process:
|
||||
|
||||
```bash
|
||||
cd /home/yunohost.app/
|
||||
borg extract "$repository::ARCHIVE_NAME" apps/nextcloud/backup/home/yunohost.app/
|
||||
mv apps/nextcloud/backup/home/yunohost.app/nextcloud ./
|
||||
rm -r apps
|
||||
```
|
||||
|
|
Loading…
Add table
Reference in a new issue