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
2016-03-23 19:30:43 +01:00

19 lines
560 B
Bash

#! /bin/bash
# causes the shell to exit if any subcommand or pipeline returns a non-zero status
set -e
app=bozon
app_path=/var/www/$app
data_path=/home/yunohost.app/$app
save_path=$1
# Backup sources & data
sudo mkdir -p $save_path/data
sudo cp -R $app_path $save_path
sudo cp -R $data_path $save_path/data
# Copy Nginx and YunoHost parameters to make the script "standalone"
sudo cp -a /etc/yunohost/apps/$app/. save_path/yunohost
domain=$(sudo yunohost app setting $app domain)
sudo cp -a /etc/nginx/conf.d/$domain.d/$app.conf save_path/nginx.conf