mirror of
https://github.com/YunoHost-Apps/bozon_ynh.git
synced 2024-09-03 18:16:09 +02:00
25 lines
620 B
Bash
25 lines
620 B
Bash
#! /bin/bash
|
|
|
|
# Exit on command errors and treat unset variables as an error
|
|
set -eu
|
|
|
|
# Source YunoHost helpers
|
|
source /usr/share/yunohost/helpers
|
|
|
|
# retrieve arguments
|
|
app=$YNH_APP_INSTANCE_NAME
|
|
domain=$(ynh_app_setting_get "$app" domain)
|
|
|
|
# definie useful vars
|
|
parent_path=/var/www
|
|
final_path="$parent_path"/"$app"
|
|
data_path=/home/yunohost.app/"$app"
|
|
|
|
# backup sources & data
|
|
ynh_backup "$final_path" "www"
|
|
ynh_backup "$data_path" "data"
|
|
|
|
# backup Nginx and php-fpm
|
|
mkdir ./conf
|
|
ynh_backup "/etc/nginx/conf.d/${domain}.d/${app}.conf" "conf/nginx.conf"
|
|
ynh_backup "/etc/php5/fpm/pool.d/${app}.conf" "conf/php-fpm.conf"
|