2014-11-04 08:47:50 +00:00
|
|
|
#!/bin/bash
|
2015-10-04 20:57:54 +00:00
|
|
|
# This backup script is adapted to Yunohost >=2.4
|
2014-11-04 08:47:50 +00:00
|
|
|
|
2015-10-04 20:57:54 +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
|
2015-10-04 20:57:54 +00:00
|
|
|
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
|
2015-10-04 20:57:54 +00:00
|
|
|
final_path=/var/www/$APP
|
|
|
|
sudo cp -a $final_path "${backup_dir}/www"
|
2014-11-04 08:47:50 +00:00
|
|
|
|
2015-10-04 20:57:54 +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)
|
2015-10-04 20:57:54 +00: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
|