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
|
|
|
|
domain=$(ynh_app_setting_get "$app" domain)
|
|
|
|
|
|
|
|
# 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
|
|
|
|
ynh_backup "$final_path"
|
|
|
|
ynh_backup "$home_path"
|
|
|
|
ynh_backup "/etc/nginx/conf.d/$domain.d/$app.conf"
|
2018-12-18 07:30:30 +01:00
|
|
|
ynh_backup "/etc/sudoers.d/$app"
|
2018-09-25 19:03:30 +02:00
|
|
|
ynh_backup "/etc/systemd/system/$app@$app.service"
|