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:
parent
3f59b7a139
commit
1bff97c8e6
5 changed files with 14 additions and 5 deletions
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
app=${!#}
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
#!/bin/bash
|
||||
|
||||
# causes the shell to exit if any subcommand or pipeline returns a non-zero status
|
||||
set -e
|
||||
|
||||
app=${!#}
|
||||
|
|
Loading…
Add table
Reference in a new issue