2016-02-09 00:48:21 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
2017-02-14 10:58:25 +01:00
|
|
|
set -eu
|
2016-02-09 00:48:21 +01:00
|
|
|
|
2017-02-14 09:40:18 +01:00
|
|
|
# Source app helpers
|
|
|
|
. /usr/share/yunohost/helpers
|
|
|
|
|
2016-02-09 00:48:21 +01:00
|
|
|
# retrieve useful param
|
2017-03-12 19:27:31 +01:00
|
|
|
app=$YNH_APP_INSTANCE_NAME
|
|
|
|
path=$(ynh_app_setting_get "$app" path)
|
|
|
|
dbpass=$(ynh_app_setting_get "$app" mysqlpwd)
|
|
|
|
domain=$(ynh_app_setting_get "$app" domain)
|
2016-02-09 00:48:21 +01:00
|
|
|
|
|
|
|
# Backup app files
|
2017-03-12 19:27:31 +01:00
|
|
|
ynh_backup "$path" "www"
|
2016-02-09 00:48:21 +01:00
|
|
|
# Backup conf files
|
2017-03-12 19:27:31 +01:00
|
|
|
ynh_backup "/etc/nginx/conf.d/$domain.d/$app.conf" "conf"
|
|
|
|
ynh_backup "/etc/cron.d/$app" "conf"
|
2016-02-09 00:48:21 +01:00
|
|
|
|
|
|
|
# Backup mysql
|
2017-03-12 19:27:31 +01:00
|
|
|
ynh_mysql_dump_db $app > $app.dmp
|