garage_ynh/scripts/backup

21 lines
613 B
Text
Raw Normal View History

2014-11-04 08:47:50 +00:00
#!/bin/bash
# This backup script is adapted to Yunohost >=2.4
2014-11-04 08:47:50 +00:00
# The parameter $1 is the backup directory location dedicated to the app
2014-11-04 08:47:50 +00: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 08:47:50 +00:00
# Backup sources & data
final_path=/var/www/$APP
sudo cp -a $final_path "${backup_dir}/www"
2014-11-04 08:47:50 +00:00
# Copy conf file
sudo mkdir -p "${backup_dir}/conf"
2014-11-04 08:47:50 +00: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