1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/bozon_ynh.git synced 2024-09-03 18:16:09 +02:00
bozon_ynh/scripts/backup

26 lines
619 B
Text
Raw Normal View History

#!/bin/bash
2016-03-23 19:30:43 +01:00
2016-10-13 06:51:38 +02:00
# Exit on command errors and treat unset variables as an error
set -eu
2016-05-23 21:40:55 +02:00
2016-10-13 06:51:38 +02:00
# Source YunoHost helpers
source /usr/share/yunohost/helpers
2016-05-23 21:40:55 +02:00
# retrieve arguments
2016-10-13 06:51:38 +02:00
app=$YNH_APP_INSTANCE_NAME
domain=$(ynh_app_setting_get "$app" domain)
2016-03-23 19:30:43 +01:00
2016-04-04 20:01:54 +02:00
# definie useful vars
parent_path=/var/www
2016-10-13 06:51:38 +02:00
final_path="$parent_path"/"$app"
data_path=/home/yunohost.app/"$app"
2016-04-04 20:01:54 +02:00
2016-04-05 20:03:26 +02:00
# backup sources & data
2016-10-13 06:51:38 +02:00
ynh_backup "$final_path" "www"
ynh_backup "$data_path" "data"
2016-03-23 19:30:43 +01:00
2016-10-13 06:51:38 +02:00
# 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"