1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/ttrss_ynh.git synced 2024-10-01 13:34:46 +02:00

[enh] Update scripts with ynh_backup helper.

This commit is contained in:
opi 2016-05-10 14:21:26 +02:00
parent 3f59b7a139
commit 1bff97c8e6
5 changed files with 14 additions and 5 deletions

View file

@ -1,5 +1,8 @@
#!/bin/bash
# causes the shell to exit if any subcommand or pipeline returns a non-zero status
set -e
# The parameter $1 is the backup directory location dedicated to the app
backup_dir=$1
@ -11,12 +14,12 @@ path=$(sudo yunohost app setting $app path)
# Copy the app files
final_path="/var/www/$app"
sudo cp -a "$final_path" ./www
ynh_backup "$final_path" "./www"
# Copy the conf files
sudo mkdir -p ./conf
sudo cp -a /etc/nginx/conf.d/$domain.d/$app.conf ./conf/nginx.conf
sudo cp -a /etc/cron.d/$app ./conf/cron
ynh_backup "/etc/nginx/conf.d/$domain.d/$app.conf" "./conf/nginx.conf"
ynh_backup "/etc/cron.d/$app" "./conf/cron"
# Backup db
root_pwd=$(sudo cat /etc/yunohost/mysql)

View file

@ -1,5 +1,8 @@
#!/bin/bash
# causes the shell to exit if any subcommand or pipeline returns a non-zero status
set -e
# Retrieve arguments
domain=$1
path=$2

View file

@ -1,5 +1,4 @@
#!/bin/bash
set -e
app=${!#}

View file

@ -1,5 +1,7 @@
#!/bin/bash
# This restore script is adapted to Yunohost >=2.4
# causes the shell to exit if any subcommand or pipeline returns a non-zero status
set -e
# The parameter $1 is the backup directory location dedicated to the app
backup_dir=$1

View file

@ -1,4 +1,6 @@
#!/bin/bash
# causes the shell to exit if any subcommand or pipeline returns a non-zero status
set -e
app=${!#}