mirror of
https://github.com/YunoHost-Apps/zabbix_ynh.git
synced 2024-09-03 20:36:14 +02:00
80 lines
No EOL
2.7 KiB
Bash
80 lines
No EOL
2.7 KiB
Bash
#!/bin/bash
|
|
|
|
#=================================================
|
|
# GENERIC START
|
|
#=================================================
|
|
# IMPORT GENERIC HELPERS
|
|
#=================================================
|
|
|
|
source ../settings/scripts/_common.sh
|
|
source /usr/share/yunohost/helpers
|
|
|
|
#=================================================
|
|
# MANAGE SCRIPT FAILURE
|
|
#=================================================
|
|
|
|
ynh_clean_setup () {
|
|
### Remove this function if there's nothing to clean before calling the remove script.
|
|
true
|
|
}
|
|
# Exit if an error occurs during the execution of the script
|
|
ynh_abort_if_errors
|
|
|
|
#=================================================
|
|
# LOAD SETTINGS
|
|
#=================================================
|
|
|
|
app="zabbix"
|
|
|
|
final_path=$(ynh_app_setting_get $app final_path)
|
|
domain=$(ynh_app_setting_get $app domain)
|
|
db_name=$(ynh_app_setting_get $app db_name)
|
|
nonfree=$(ynh_app_setting_get $app nonfree)
|
|
|
|
|
|
#=================================================
|
|
# STANDARD BACKUP STEPS
|
|
#=================================================
|
|
# BACKUP THE APP MAIN DIR
|
|
#=================================================
|
|
|
|
#backup frontend config
|
|
ynh_print_info "Backup $final_path conf/zabbix.conf.php"
|
|
ynh_backup "$final_path/conf/zabbix.conf.php"
|
|
ynh_print_info "Backup /etc/zabbix/web"
|
|
ynh_backup "/etc/zabbix/web"
|
|
#ynh_print_info "Backup /etc/zabbix/web/init.zabbix.conf.php.sh"
|
|
#ynh_backup "/etc/zabbix/web/init.zabbix.conf.php.sh"
|
|
ynh_print_info "Backup /etc/apt/apt.conf.d/100update_force_init_zabbix_frontend_config"
|
|
ynh_backup "/etc/apt/apt.conf.d/100update_force_init_zabbix_frontend_config"
|
|
|
|
#backup server confif
|
|
ynh_print_info "Backup /etc/zabbix/zabbix_server.conf"
|
|
ynh_backup "/etc/zabbix/zabbix_server.conf"
|
|
|
|
#backup agent config
|
|
ynh_print_info "Backup /etc/zabbix/zabbix_agentd.conf"
|
|
ynh_backup "/etc/zabbix/zabbix_agentd.conf"
|
|
ynh_print_info "Backup /etc/zabbix/zabbix_agentd.d"
|
|
ynh_backup "/etc/zabbix/zabbix_agentd.d"
|
|
|
|
#backup sudo file
|
|
ynh_print_info "Backup /etc/sudoers.d/zabbix"
|
|
ynh_backup "/etc/sudoers.d/zabbix"
|
|
|
|
#=================================================
|
|
# BACKUP THE NGINX CONFIGURATION
|
|
#=================================================
|
|
ynh_print_info "Backup /etc/nginx/conf.d/$domain.d/$app.conf"
|
|
ynh_backup "/etc/nginx/conf.d/$domain.d/$app.conf"
|
|
#=================================================
|
|
# BACKUP THE PHP-FPM CONFIGURATION
|
|
#=================================================
|
|
ynh_print_info "Backup /etc/php/7.0/fpm/pool.d/$app.conf"
|
|
ynh_backup "/etc/php/7.0/fpm/pool.d/$app.conf"
|
|
|
|
#=================================================
|
|
# BACKUP THE MYSQL DATABASE
|
|
#=================================================
|
|
ynh_print_info "Backup Zabbix database"
|
|
ynh_mysql_dump_db "$db_name" > db.sql |