mirror of
https://github.com/YunoHost-Apps/mattermost_ynh.git
synced 2024-09-03 19:36:29 +02:00
58 lines
1.5 KiB
Bash
Executable file
58 lines
1.5 KiB
Bash
Executable file
#!/bin/bash
|
|
|
|
#=================================================
|
|
# IMPORT GENERIC HELPERS
|
|
#=================================================
|
|
|
|
source /usr/share/yunohost/helpers
|
|
|
|
#=================================================
|
|
# MANAGE SCRIPT FAILURE
|
|
#=================================================
|
|
|
|
# Exit if an error occurs during the execution of the script
|
|
ynh_abort_if_errors
|
|
|
|
#=================================================
|
|
# LOAD SETTINGS
|
|
#=================================================
|
|
|
|
app=$YNH_APP_INSTANCE_NAME
|
|
|
|
final_path="/var/www/$app"
|
|
data_path="/home/yunohost.app/$app"
|
|
domain=$(ynh_app_setting_get $app domain)
|
|
db_name="$app"
|
|
|
|
#=================================================
|
|
# STANDARD BACKUP STEPS
|
|
#=================================================
|
|
# BACKUP THE APP MAIN DIR
|
|
#=================================================
|
|
|
|
ynh_backup "$final_path"
|
|
|
|
#=================================================
|
|
# BACKUP THE APP DATA
|
|
#=================================================
|
|
|
|
ynh_backup "$data_path"
|
|
|
|
#=================================================
|
|
# BACKUP THE DATABASE
|
|
#=================================================
|
|
|
|
ynh_mysql_dump_db "$db_name" > db.sql
|
|
ynh_backup "db.sql"
|
|
|
|
#=================================================
|
|
# BACKUP THE NGINX CONFIGURATION
|
|
#=================================================
|
|
|
|
ynh_backup "/etc/nginx/conf.d/$domain.d/$app.conf"
|
|
|
|
#=================================================
|
|
# BACKUP SYSTEMD
|
|
#=================================================
|
|
|
|
ynh_backup "/etc/systemd/system/$app.service"
|