2014-11-04 10:47:50 +02:00
|
|
|
#!/bin/bash
|
2015-10-04 23:57:54 +03:00
|
|
|
# This backup script is adapted to Yunohost >=2.4
|
2014-11-04 10:47:50 +02:00
|
|
|
|
2015-10-04 23:57:54 +03:00
|
|
|
# The parameter $1 is the backup directory location dedicated to the app
|
2014-11-04 10:47:50 +02:00
|
|
|
# which will be compressed afterward
|
2015-10-04 23:57:54 +03:00
|
|
|
backup_dir=$1
|
|
|
|
|
|
|
|
# The parameter $2 is theid of the app instance ex: ynhexample__2
|
|
|
|
app=$2
|
2014-11-04 10:47:50 +02:00
|
|
|
|
|
|
|
# Backup sources & data
|
2015-10-04 23:57:54 +03:00
|
|
|
final_path=/var/www/$APP
|
|
|
|
sudo cp -a $final_path "${backup_dir}/www"
|
2014-11-04 10:47:50 +02:00
|
|
|
|
2015-10-04 23:57:54 +03:00
|
|
|
# Copy conf file
|
|
|
|
sudo mkdir -p "${backup_dir}/conf"
|
2014-11-04 10:47:50 +02:00
|
|
|
domain=$(sudo yunohost app setting $app domain)
|
2015-10-04 23:57:54 +03:00
|
|
|
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
|