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
c3e20aa281
5 changed files with 31 additions and 4 deletions
27
README.md
27
README.md
|
@ -125,12 +125,39 @@ If you want to make a complete check of the backups - keep in mind that this rea
|
||||||
systemctl start restic_check_read_data.service
|
systemctl start restic_check_read_data.service
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Display the apps list to backup
|
||||||
|
|
||||||
|
```
|
||||||
|
yunohost app setting restic apps
|
||||||
|
```
|
||||||
|
|
||||||
## Edit the apps list to backup
|
## Edit the apps list to backup
|
||||||
|
|
||||||
```
|
```
|
||||||
yunohost app setting restic apps -v "nextcloud,wordpress"
|
yunohost app setting restic apps -v "nextcloud,wordpress"
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Launch a backup
|
||||||
|
|
||||||
|
```
|
||||||
|
systemctl start restic
|
||||||
|
```
|
||||||
|
|
||||||
|
## Launch a backups check
|
||||||
|
|
||||||
|
```
|
||||||
|
systemctl start restic_check.service
|
||||||
|
```
|
||||||
|
|
||||||
|
## Launch a complete backups check
|
||||||
|
|
||||||
|
WARNING: this will read data from your backups destination server.
|
||||||
|
It may take a quite long time depending on the target server's internet upload speed and hardware performance.
|
||||||
|
|
||||||
|
```
|
||||||
|
systemctl start restic_check_read_data.service
|
||||||
|
```
|
||||||
|
|
||||||
## Backup on different server, and apply distinct schedule for apps
|
## 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.
|
||||||
|
|
|
@ -39,7 +39,7 @@ fi
|
||||||
|
|
||||||
# Backup all apps independently
|
# Backup all apps independently
|
||||||
apps=$(sudo yunohost app setting {{ app }} apps)
|
apps=$(sudo yunohost app setting {{ app }} apps)
|
||||||
for app in $(ls /etc/yunohost/apps/*/scripts/backup | cut -d / -f 5); do
|
for app in $(sudo /usr/bin/find /etc/yunohost/apps -name backup | cut -d / -f 5); do
|
||||||
backup_app=false
|
backup_app=false
|
||||||
for selected_app in $(echo $apps | tr "," " ");do
|
for selected_app in $(echo $apps | tr "," " ");do
|
||||||
if [[ "$selected_app" == "$app" ]] || [ "$apps" = "all" ]; then
|
if [[ "$selected_app" == "$app" ]] || [ "$apps" = "all" ]; then
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
"en": "Backup your server with restic.",
|
"en": "Backup your server with restic.",
|
||||||
"fr": "Sauvegardez votre serveur avec restic."
|
"fr": "Sauvegardez votre serveur avec restic."
|
||||||
},
|
},
|
||||||
"version": "0.12.0~ynh4",
|
"version": "0.12.0~ynh5",
|
||||||
"url": "https://restic.net/",
|
"url": "https://restic.net/",
|
||||||
"license": "BSD-2-Clause",
|
"license": "BSD-2-Clause",
|
||||||
"maintainer": {
|
"maintainer": {
|
||||||
|
|
|
@ -43,7 +43,7 @@ ynh_script_progression --message="Creating user ${app}"
|
||||||
useradd -m ${app}
|
useradd -m ${app}
|
||||||
ynh_script_progression --message="Configure ${app} user sudoer rights"
|
ynh_script_progression --message="Configure ${app} user sudoer rights"
|
||||||
cat > /tmp/${app}_sudoer << EOSUDOER
|
cat > /tmp/${app}_sudoer << EOSUDOER
|
||||||
${app} ALL = (root) NOPASSWD: /usr/bin/yunohost*, /bin/journalctl*
|
${app} ALL = (root) NOPASSWD: /usr/bin/yunohost*, /bin/journalctl*, /usr/bin/find /etc/yunohost/apps -name backup
|
||||||
EOSUDOER
|
EOSUDOER
|
||||||
visudo -cf /tmp/${app}_sudoer && mv /tmp/${app}_sudoer /etc/sudoers.d/${app}
|
visudo -cf /tmp/${app}_sudoer && mv /tmp/${app}_sudoer /etc/sudoers.d/${app}
|
||||||
|
|
||||||
|
|
|
@ -67,7 +67,7 @@ ynh_script_progression --message="Creating user ${app}"
|
||||||
id ${app} 2>/dev/null || useradd -m ${app}
|
id ${app} 2>/dev/null || useradd -m ${app}
|
||||||
ynh_script_progression --message="Configure ${app} user sudoer rights"
|
ynh_script_progression --message="Configure ${app} user sudoer rights"
|
||||||
cat > /tmp/${app}_sudoer << EOSUDOER
|
cat > /tmp/${app}_sudoer << EOSUDOER
|
||||||
${app} ALL = (root) NOPASSWD: /usr/bin/yunohost*, /bin/journalctl*
|
${app} ALL = (root) NOPASSWD: /usr/bin/yunohost*, /bin/journalctl*, /usr/bin/find /etc/yunohost/apps -name backup
|
||||||
EOSUDOER
|
EOSUDOER
|
||||||
visudo -cf /tmp/${app}_sudoer && mv /tmp/${app}_sudoer /etc/sudoers.d/${app}
|
visudo -cf /tmp/${app}_sudoer && mv /tmp/${app}_sudoer /etc/sudoers.d/${app}
|
||||||
ynh_script_progression --message="Move ssh keys from root to ${app} user's home"
|
ynh_script_progression --message="Move ssh keys from root to ${app} user's home"
|
||||||
|
|
Loading…
Add table
Reference in a new issue