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

21 lines
613 B
Text
Raw Normal View History

2014-11-04 09:47:50 +01:00
#!/bin/bash
# This backup script is adapted to Yunohost >=2.4
2014-11-04 09:47:50 +01:00
# The parameter $1 is the backup directory location dedicated to the app
2014-11-04 09:47:50 +01:00
# which will be compressed afterward
backup_dir=$1
# The parameter $2 is theid of the app instance ex: ynhexample__2
app=$2
2014-11-04 09:47:50 +01:00
# Backup sources & data
final_path=/var/www/$APP
sudo cp -a $final_path "${backup_dir}/www"
2014-11-04 09:47:50 +01:00
# Copy conf file
sudo mkdir -p "${backup_dir}/conf"
2014-11-04 09:47:50 +01:00
domain=$(sudo yunohost app setting $app domain)
sudo cp -a /etc/nginx/conf.d/$domain.d/$app.conf "${backup_dir}/conf/nginx.conf"
# Since Yunohost 2.4 no need to backup settings in /etc/yunohost/apps/$app