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

23 lines
580 B
Text
Raw Normal View History

2016-03-23 19:30:43 +01:00
#! /bin/bash
# causes the shell to exit if any subcommand or pipeline returns a non-zero status
set -e
2016-04-04 20:01:54 +02:00
# definie useful vars
2016-03-23 19:30:43 +01:00
app=bozon
2016-04-04 20:01:54 +02:00
parent_path=/var/www
final_path=$parent_path/$app
2016-04-05 20:03:26 +02:00
data_path=/home/yunohost.app/$app
2016-04-04 20:01:54 +02:00
#retrieve arguments
2016-03-23 19:30:43 +01:00
save_path=$1
2016-04-04 20:01:54 +02:00
domain=$(sudo yunohost app setting $app domain)
2016-03-23 19:30:43 +01:00
2016-04-05 20:03:26 +02:00
# backup sources & data
sudo cp -R $final_path/. $save_path/www/
sudo cp -R $data_path/. $save_path/datas/
2016-03-23 19:30:43 +01:00
2016-04-05 20:03:26 +02:00
# backup Nginx and YunoHost parameters
sudo cp -a /etc/yunohost/apps/$app/. $save_path/yunohost/
2016-04-04 20:01:54 +02:00
sudo cp -a /etc/nginx/conf.d/$domain.d/$app.conf $save_path/nginx.conf