#! /bin/bash # causes the shell to exit if any subcommand or pipeline returns a non-zero status set -e # definie useful vars app=bozon parent_path=/var/www final_path=$parent_path/$app data_path=/home/yunohost.app/$app #retrieve arguments save_path=$1 domain=$(sudo yunohost app setting $app domain) # backup sources & data sudo cp -R $final_path/. $save_path/www/ sudo cp -R $data_path/. $save_path/datas/ # backup php-fpm, Nginx and YunoHost parameters sudo cp -a /etc/yunohost/apps/$app/. $save_path/yunohost/ sudo cp -a /etc/nginx/conf.d/$domain.d/$app.conf $save_path/nginx.conf sudo cp -a /etc/php5/fpm/pool.d/$app.conf $save_path/php-fpm.conf