2018-09-25 19:03:30 +02:00
|
|
|
#!/bin/bash
|
|
|
|
# to test the functionnality :
|
|
|
|
# yunohost backup create -n "homeassistant-test" --apps homeassistant
|
|
|
|
# yunohost backup delete homeassistant-test
|
|
|
|
|
|
|
|
source /usr/share/yunohost/helpers
|
|
|
|
|
|
|
|
# manage script failure
|
|
|
|
ynh_abort_if_errors
|
|
|
|
|
|
|
|
# retrieve arguments
|
|
|
|
app=$YNH_APP_INSTANCE_NAME
|
2020-11-16 15:10:12 +01:00
|
|
|
domain=$(ynh_app_setting_get --app="$app" --key=domain)
|
2018-09-25 19:03:30 +02:00
|
|
|
|
|
|
|
# definie useful vars
|
2018-10-18 05:16:40 +02:00
|
|
|
final_path="/opt/yunohost/$app"
|
2018-09-25 19:03:30 +02:00
|
|
|
home_path="/home/$app"
|
|
|
|
|
|
|
|
# backup source & conf files
|
2020-08-12 22:22:59 +02:00
|
|
|
ynh_backup --src_path="$final_path"
|
|
|
|
ynh_backup --src_path="$home_path"
|
|
|
|
ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf"
|
|
|
|
ynh_backup --src_path="/etc/sudoers.d/$app"
|
|
|
|
ynh_backup --src_path="/etc/systemd/system/$app@$app.service"
|