#!/bin/bash # causes the shell to exit if any subcommand or pipeline returns a non-zero status set -eu # Source YNH helpers source /usr/share/yunohost/helpers app=$YNH_APP_INSTANCE_NAME # Retrieve arguments domain=$(ynh_app_setting_get "$app" domain) # Backup directory location for the app from where the script is executed and # which will be compressed afterward backup_dir=$YNH_APP_BACKUP_DIR # Backup sources & data ynh_backup "/var/www/${app}" "sources" # Copy Nginx conf sudo mkdir -p ./conf ynh_backup "/etc/nginx/conf.d/${domain}.d/${app}.conf" "conf/nginx.conf" # Copy the php-fpm conf files ynh_backup "/etc/php5/fpm/pool.d/${app}.conf" "conf/php-fpm.conf" ynh_backup "/etc/php5/fpm/conf.d/20-${app}.ini" "conf/php-fpm.ini"