mirror of
https://github.com/YunoHost-Apps/restic_ynh.git
synced 2024-09-03 20:16:22 +02:00
Merge branch 'testing'
This commit is contained in:
commit
7448183aac
8 changed files with 62 additions and 15 deletions
43
README.md
43
README.md
|
@ -1,14 +1,18 @@
|
|||
# restic for Yunohost
|
||||
# Restic for YunoHost
|
||||
|
||||
[](https://github.com/YunoHost-Apps/restic_ynh/releases)
|
||||
[](https://github.com/YunoHost-Apps/restic_ynh/milestones)
|
||||
[](https://dash.yunohost.org/appci/app/restic)
|
||||
[](https://raw.githubusercontent.com/YunoHost-Apps/restic_ynh/master/LICENSE)
|
||||
[](https://github.com/YunoHost-Apps/restic_ynh/issues)
|
||||
|
||||
[](https://install-app.yunohost.org/?app=restic)
|
||||
|
||||
A [restic](https://restic.net/) package for YunoHost (heavily inspired by [the Borg package](https://github.com/YunoHost-Apps/borg_ynh/)).
|
||||
> *This package allows you to install Restic quickly and simply on a YunoHost server.
|
||||
If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/install) to learn how to install it.*
|
||||
|
||||
## Overview
|
||||
|
||||
A [Restic](https://restic.net/) package for YunoHost (heavily inspired by [the Borg package](https://github.com/YunoHost-Apps/borg_ynh/)).
|
||||
|
||||
Restic is a backup tool that can make local and remote backups.
|
||||
This package uses restic to make backups to a sftp server.
|
||||
|
@ -17,7 +21,7 @@ This package uses restic to make backups to a sftp server.
|
|||
|
||||
If you want to backup your server A onto the server B.
|
||||
|
||||
## Setup restic app on Server A
|
||||
## Setup Restic app on Server A
|
||||
|
||||
Firstly set up this app on the server A you want to backup:
|
||||
|
||||
|
@ -114,7 +118,7 @@ If you want to check the backups consistency:
|
|||
systemctl start restic_check.service
|
||||
```
|
||||
|
||||
If you want to make a complete check of the backups - keep in mind that this reads all the backed up data, it can take some time depending on your target server upload speed (more on this topic in [the restic documentation](https://restic.readthedocs.io/en/latest/045_working_with_repos.html#checking-integrity-and-consistency):
|
||||
If you want to make a complete check of the backups - keep in mind that this reads all the backed up data, it can take some time depending on your target server upload speed (more on this topic in [the Restic documentation](https://restic.readthedocs.io/en/latest/045_working_with_repos.html#checking-integrity-and-consistency):
|
||||
```
|
||||
systemctl start restic_check_read_data.service
|
||||
```
|
||||
|
@ -127,4 +131,31 @@ yunohost app setting restic apps -v "nextcloud,wordpress"
|
|||
|
||||
## Backup on different server, and apply distinct schedule for apps
|
||||
|
||||
You can setup the restic app several times on the same server so you can backup on several server or manage your frequency backup differently for specific part of your server.
|
||||
You can setup the Restic app several times on the same server so you can backup on several server or manage your frequency backup differently for specific part of your server.
|
||||
|
||||
#### Supported architectures
|
||||
|
||||
* x86-64 - [](https://ci-apps.yunohost.org/ci/apps/restic/)
|
||||
* ARMv8-A - [](https://ci-apps-arm.yunohost.org/ci/apps/restic/)
|
||||
|
||||
## Links
|
||||
|
||||
* Report a bug: https://github.com/YunoHost-Apps/restic_ynh/issues
|
||||
* App website: https://restic.net/
|
||||
* Upstream app repository: https://github.com/restic/restic
|
||||
* YunoHost website: https://yunohost.org/
|
||||
|
||||
---
|
||||
|
||||
Developer info
|
||||
----------------
|
||||
|
||||
Please send your pull request to the [testing branch](https://github.com/YunoHost-Apps/restic_ynh/tree/testing).
|
||||
|
||||
To try the testing branch, please proceed like that.
|
||||
```
|
||||
sudo yunohost app install https://github.com/YunoHost-Apps/restic_ynh/tree/testing --debug
|
||||
or
|
||||
sudo yunohost app upgrade restic -u https://github.com/YunoHost-Apps/restic_ynh/tree/testing --debug
|
||||
```
|
||||
|
||||
|
|
|
@ -2,8 +2,16 @@
|
|||
|
||||
set -e
|
||||
|
||||
RESTIC_PASSWORD="{{ passphrase }}"
|
||||
RESTIC_REPOSITORY_BASE=sftp:{{ server }}:{{ backup_path }}
|
||||
###
|
||||
# Fetch information from YNH settings
|
||||
###
|
||||
RESTIC_SERVER=$(yunohost app setting restic server)
|
||||
RESTIC_SERVER_PORT=$(yunohost app setting restic port)
|
||||
RESTIC_PATH=$(yunohost app setting restic backup_path)
|
||||
|
||||
RESTIC_PASSWORD="$(yunohost app setting restic passphrase)"
|
||||
RESTIC_REPOSITORY_BASE=sftp://$RESTIC_SERVER:$RESTIC_SERVER_PORT/$RESTIC_PATH/
|
||||
|
||||
RESTIC_COMMAND=/usr/local/bin/restic
|
||||
LOGFILE=/var/log/restic_backup.log
|
||||
ERRFILE=/var/log/restic_backup.err
|
||||
|
|
|
@ -31,7 +31,7 @@ fi
|
|||
|
||||
# Check all apps independently
|
||||
apps=$(yunohost app setting {{ app }} apps)
|
||||
for app in $(yunohost app list --installed -b | grep id: | cut -d: -f2); do
|
||||
for app in $(ls /etc/yunohost/apps/*/scripts/backup | cut -d / -f 5); do
|
||||
check_app=false
|
||||
for selected_app in $(echo $apps | tr "," " ");do
|
||||
if [[ "$selected_app" == "$app" ]] || [ "$apps" = "all" ]; then
|
||||
|
|
|
@ -2,8 +2,13 @@
|
|||
|
||||
set -e
|
||||
|
||||
RESTIC_PASSWORD="{{ passphrase }}"
|
||||
RESTIC_REPOSITORY_BASE=sftp:{{ server }}:{{ backup_path }}
|
||||
RESTIC_SERVER=$(yunohost app setting restic server)
|
||||
RESTIC_SERVER_PORT=$(yunohost app setting restic port)
|
||||
RESTIC_PATH=$(yunohost app setting restic backup_path)
|
||||
|
||||
RESTIC_PASSWORD="$(yunohost app setting restic passphrase)"
|
||||
RESTIC_REPOSITORY_BASE=sftp://$RESTIC_SERVER:$RESTIC_SERVER_PORT/$RESTIC_PATH/
|
||||
|
||||
RESTIC_COMMAND=/usr/local/bin/restic
|
||||
|
||||
do_check() {
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
"en": "Backup your server with restic.",
|
||||
"fr": "Sauvegardez votre serveur avec restic."
|
||||
},
|
||||
"version": "0.9.6~ynh6",
|
||||
"version": "0.10.0~ynh1",
|
||||
"url": "https://restic.net/",
|
||||
"license": "BSD 2-Clause \"Simplified\" License",
|
||||
"maintainer": {
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
#=================================================
|
||||
# App package root directory should be the parent folder
|
||||
PKG_DIR=$(cd ../; pwd)
|
||||
RESTIC_VERSION="0.9.6"
|
||||
RESTIC_VERSION="0.10.0"
|
||||
|
||||
# Install restic if restic is not here
|
||||
install_restic () {
|
||||
|
@ -57,7 +57,7 @@ ynh_export () {
|
|||
export $var="${!ynh_arg}"
|
||||
done
|
||||
}
|
||||
# Save listed var in YunoHost app settings
|
||||
# Save listed var in YunoHost app settings
|
||||
# usage: ynh_save_args VARNAME1 [VARNAME2 [...]]
|
||||
ynh_save_args () {
|
||||
for var in $@;
|
||||
|
|
|
@ -65,6 +65,9 @@ ynh_add_systemd_config --service=${app}_check_read_data --template=systemd_check
|
|||
ynh_configure systemd.timer "/etc/systemd/system/${app}.timer"
|
||||
ynh_configure systemd_check.timer "/etc/systemd/system/${app}_check.timer"
|
||||
ynh_configure systemd_check_read_data.timer "/etc/systemd/system/${app}_check_read_data.timer"
|
||||
systemctl disable ${app}.service
|
||||
systemctl disable ${app}_check.service
|
||||
systemctl disable ${app}_check_read_data.service
|
||||
systemctl enable ${app}.timer
|
||||
systemctl enable ${app}_check.timer
|
||||
systemctl enable ${app}_check_read_data.timer
|
||||
|
|
|
@ -38,7 +38,7 @@ mkdir -p /usr/share/yunohost/backup_method
|
|||
#=================================================
|
||||
# RESTORE FILES
|
||||
#=================================================
|
||||
ynh_restore
|
||||
ynh_restore
|
||||
|
||||
#=================================================
|
||||
# ADVERTISE SERVICE IN ADMIN PANEL
|
||||
|
|
Loading…
Add table
Reference in a new issue