mirror of
https://github.com/YunoHost-Apps/rocketchat_ynh.git
synced 2024-09-03 20:16:25 +02:00
Improves backup and restore
This commit is contained in:
parent
44e4b092ea
commit
13884597be
2 changed files with 9 additions and 7 deletions
|
@ -48,3 +48,4 @@ ynh_backup "/etc/nginx/conf.d/$domain.d/$app.conf" "${backup_dir}/etc/nginx/conf
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
sudo mongodump -o "${backup_dir}/dump"
|
sudo mongodump -o "${backup_dir}/dump"
|
||||||
|
ynh_backup "${backup_dir}/dump" "dump"
|
||||||
|
|
|
@ -27,14 +27,15 @@ path_url=$(ynh_app_setting_get $app path)
|
||||||
final_path=$(ynh_app_setting_get $app final_path)
|
final_path=$(ynh_app_setting_get $app final_path)
|
||||||
db_name=$(ynh_app_setting_get $app db_name)
|
db_name=$(ynh_app_setting_get $app db_name)
|
||||||
|
|
||||||
#=================================================
|
# Check domain/path availability
|
||||||
# CHECK IF THE APP CAN BE RESTORED
|
sudo yunohost app checkurl "${domain}${path}" -a "$app" \
|
||||||
#=================================================
|
|| ynh_die
|
||||||
|
|
||||||
sudo yunohost app checkurl "${domain}${path_url}" -a "$app" \
|
# Check destination directory
|
||||||
|| ynh_die "Path not available: ${domain}${path_url}"
|
DESTDIR="/var/www/$app"
|
||||||
test ! -d $final_path \
|
[[ -d $DESTDIR ]] && ynh_die \
|
||||||
|| ynh_die "There is already a directory: $final_path "
|
"The destination directory '$DESTDIR' already exists.\
|
||||||
|
You should safely delete it before restoring this app."
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# STANDARD RESTORATION STEPS
|
# STANDARD RESTORATION STEPS
|
||||||
|
|
Loading…
Add table
Reference in a new issue