mirror of
https://github.com/YunoHost-Apps/homeassistant_ynh.git
synced 2024-09-03 19:26:16 +02:00
24 lines
690 B
Bash
24 lines
690 B
Bash
#!/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="$app" --key=domain)
|
|
|
|
# definie useful vars
|
|
final_path="/opt/yunohost/$app"
|
|
home_path="/home/$app"
|
|
|
|
# backup source & conf files
|
|
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"
|