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
|
2017-03-12 19:31:50 +01:00
|
|
|
path=/var/www/$app
|
2017-03-12 19:27:31 +01:00
|
|
|
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:46:53 +01:00
|
|
|
ynh_backup "/etc/nginx/conf.d/$domain.d/$app.conf" "nginx.conf"
|
2017-12-03 15:16:37 +01:00
|
|
|
ynh_backup "/etc/cron.d/$app" "cron"
|
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
|