1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/monitorix_ynh.git synced 2024-09-03 19:46:06 +02:00
monitorix_ynh/scripts/backup
2019-10-30 21:45:48 +01:00

41 lines
1.3 KiB
Bash
Executable file

#!/bin/bash
#=================================================
# GENERIC START
#=================================================
# Source YunoHost helpers
source /usr/share/yunohost/helpers
# Stop script if errors
ynh_abort_if_errors
# Import common cmd
source ../settings/scripts/experimental_helper.sh
source ../settings/scripts/_common.sh
# Retrieve arguments
ynh_script_progression --message="Loading installation settings..."
domain=$(ynh_app_setting_get --app $app --key domain)
#=================================================
# STANDARD BACKUP STEPS
#=================================================
# Copy NGINX configuration
ynh_script_progression --message="Backing up configuration..."
domain=$(ynh_app_setting_get --app $app --key domain)
ynh_backup --src_path "/etc/nginx/conf.d/${domain}.d/${app}.conf"
ynh_backup --src_path "/etc/nginx/conf.d/monitorix_status.conf"
# Copy hook
ynh_backup --src_path "/etc/yunohost/hooks.d/post_iptable_rules/50-$app"
# Copy Monitorix configuration
ynh_backup --src_path "/etc/monitorix"
# Copy Monitorix data
ynh_script_progression --message="Backing up data..." --weight=10
ynh_backup --src_path "/var/lib/monitorix"
ynh_script_progression --message="Backup script completed for $app. (YunoHost will then actually copy those files to the archive)." --last