1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/octoprint_ynh.git synced 2024-09-03 19:46:26 +02:00
octoprint_ynh/scripts/backup
2020-01-25 22:46:07 +01:00

24 lines
611 B
Bash

#!/bin/bash
# to test the functionnality :
# yunohost backup create -n "octoprint-test" --apps octoprint
# yunohost backup delete octoprint-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
final_path="/opt/yunohost/$app"
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"
ynh_backup "/etc/sudoers.d/$app"
ynh_backup "/etc/systemd/system/$app@$app.service"