mirror of
https://github.com/YunoHost-Apps/mattermost_ynh.git
synced 2024-09-03 19:36:29 +02:00
Merge pull request #85 from YunoHost-Apps/fix-data-backup
Fix Mattermost data backup
This commit is contained in:
commit
fd988d0cfa
2 changed files with 17 additions and 6 deletions
|
@ -20,10 +20,9 @@ ynh_abort_if_errors
|
|||
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"
|
||||
default_backup_dir="${1}apps/$app"
|
||||
backup_dir=${backup_dir:-"$default_backup_dir"}
|
||||
|
||||
#=================================================
|
||||
# STANDARD BACKUP STEPS
|
||||
|
@ -31,23 +30,29 @@ backup_dir=${backup_dir:-"$default_backup_dir"}
|
|||
# BACKUP THE APP MAIN DIR
|
||||
#=================================================
|
||||
|
||||
ynh_backup "$final_path" "${backup_dir}$final_path"
|
||||
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_dir}/db.sql"
|
||||
ynh_backup "db.sql"
|
||||
|
||||
#=================================================
|
||||
# BACKUP THE NGINX CONFIGURATION
|
||||
#=================================================
|
||||
|
||||
ynh_backup "/etc/nginx/conf.d/$domain.d/$app.conf" "${backup_dir}/etc/nginx/conf.d/$domain.d/$app.conf"
|
||||
ynh_backup "/etc/nginx/conf.d/$domain.d/$app.conf"
|
||||
|
||||
#=================================================
|
||||
# BACKUP SYSTEMD
|
||||
#=================================================
|
||||
|
||||
ynh_backup "/etc/systemd/system/$app.service" "${backup_dir}/etc/systemd/system/$app.service"
|
||||
ynh_backup "/etc/systemd/system/$app.service"
|
||||
|
|
|
@ -51,6 +51,12 @@ ynh_restore_file "/etc/nginx/conf.d/$domain.d/$app.conf"
|
|||
|
||||
ynh_restore_file "$final_path"
|
||||
|
||||
#=================================================
|
||||
# RESTORE THE APP DATA
|
||||
#=================================================
|
||||
|
||||
ynh_restore_file "$data_path"
|
||||
|
||||
#=================================================
|
||||
# RESTORE THE MYSQL DATABASE
|
||||
#=================================================
|
||||
|
|
Loading…
Reference in a new issue