1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/phpmyadmin_ynh.git synced 2024-09-03 19:56:46 +02:00
phpmyadmin_ynh/scripts/backup

66 lines
1.9 KiB
Text
Raw Normal View History

2017-02-15 01:00:22 +01:00
#!/bin/bash
2017-08-29 02:34:05 +02:00
#=================================================
# GENERIC START
#=================================================
# MANAGE SCRIPT FAILURE
#=================================================
# Exit on command errors and treat access to unset variables as an error
2017-02-25 01:12:07 +01:00
set -eu
2017-08-29 02:34:05 +02:00
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
# if [ ! -e _common.sh ]; then
# # Get the _common.sh file if it's not in the current directory
# cp ../settings/scripts/_common.sh ./_common.sh
# chmod a+rx _common.sh
# fi
# source _common.sh
2017-02-15 01:00:22 +01:00
source /usr/share/yunohost/helpers
2017-08-29 02:34:05 +02:00
#=================================================
# MANAGE SCRIPT FAILURE
#=================================================
# Exit if an error occurs during the execution of the script
ynh_abort_if_errors
#=================================================
2017-08-29 02:34:05 +02:00
# LOAD SETTINGS
#=================================================
2017-02-15 01:00:22 +01:00
app=$YNH_APP_INSTANCE_NAME
final_path=$(ynh_app_setting_get $app final_path)
domain=$(ynh_app_setting_get $app domain)
2017-08-29 02:34:05 +02:00
db_name=$(ynh_app_setting_get $app db_name)
#=================================================
# STANDARD BACKUP STEPS
#=================================================
# BACKUP THE APP MAIN DIR
#=================================================
ynh_backup "$final_path"
2017-02-15 01:00:22 +01:00
2017-08-29 02:34:05 +02:00
#=================================================
# BACKUP THE NGINX CONFIGURATION
#=================================================
2017-02-15 01:00:22 +01:00
2017-08-29 02:34:05 +02:00
ynh_backup "/etc/nginx/conf.d/$domain.d/$app.conf"
2017-02-15 01:00:22 +01:00
2017-08-29 02:34:05 +02:00
#=================================================
# BACKUP THE PHP-FPM CONFIGURATION
#=================================================
2017-02-17 21:37:28 +01:00
2017-08-29 02:34:05 +02:00
ynh_backup "/etc/php5/fpm/pool.d/$app.conf"
2017-02-15 01:00:22 +01:00
2017-08-29 02:34:05 +02:00
#=================================================
# BACKUP THE MYSQL DATABASE
#=================================================
2017-02-15 01:00:22 +01:00
2017-08-29 02:34:05 +02:00
ynh_mysql_dump_db "$db_name" > db.sql