mirror of
https://github.com/YunoHost-Apps/scrumblr_ynh.git
synced 2024-09-03 20:16:29 +02:00
Update backup
This commit is contained in:
parent
7826a68ca4
commit
36481b00e4
1 changed files with 12 additions and 6 deletions
|
@ -5,6 +5,9 @@ set -eu
|
|||
# Récupère les infos de l'application.
|
||||
app=$YNH_APP_INSTANCE_NAME
|
||||
|
||||
# The parameter $1 is the backup directory location dedicated to the app
|
||||
backup_dir=$1
|
||||
|
||||
# Source app helpers
|
||||
source /usr/share/yunohost/helpers
|
||||
|
||||
|
@ -12,17 +15,20 @@ final_path=$(ynh_app_setting_get $app final_path)
|
|||
domain=$(ynh_app_setting_get $app domain)
|
||||
codename=$(ynh_app_setting_get $app codename)
|
||||
|
||||
# The parameter $1 is the backup directory location
|
||||
# which will be compressed afterward
|
||||
backup_dir=$1/apps/$app
|
||||
sudo mkdir -p "$backup_dir"
|
||||
# Copy the app files
|
||||
sudo mkdir -p ${backup_dir}/var/www
|
||||
sudo cp -a $final_path "${backup_dir}/var/www/$app"
|
||||
|
||||
# Backup sources & data
|
||||
sudo mkdir -p "${backup_dir}/sources"
|
||||
sudo cp -a $final_path/* $backup_dir/sources
|
||||
|
||||
# Copy Nginx and YunoHost parameters to make the script "standalone"
|
||||
sudo cp -a /etc/yunohost/apps/$app/* $backup_dir/yunohost
|
||||
sudo cp -a /etc/nginx/conf.d/$domain.d/$app.conf $backup_dir/nginx.conf
|
||||
# Copy the conf files
|
||||
sudo mkdir -p "${backup_dir}/conf"
|
||||
sudo cp -a /etc/nginx/conf.d/$domain.d/$app.conf "${backup_dir}/conf/nginx.conf"
|
||||
sudo mkdir -p "${backup_dir}/yunohost"
|
||||
sudo cp -a /etc/yunohost/apps/$app/. $backup_dir/yunohost
|
||||
|
||||
|
||||
sudo cp -a /etc/systemd/system/scrumblr.service $backup_dir/
|
||||
|
|
Loading…
Add table
Reference in a new issue