From 5270a05fc0690ac378edee33dcae5e502256100c Mon Sep 17 00:00:00 2001 From: Maniack Crudelis Date: Tue, 5 Mar 2019 16:48:34 +0100 Subject: [PATCH] Handle datadir not backup --- scripts/restore | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/scripts/restore b/scripts/restore index 85088ee..3811c56 100644 --- a/scripts/restore +++ b/scripts/restore @@ -72,7 +72,17 @@ ynh_restore_file "/etc/php/7.0/fpm/pool.d/$app.conf" #================================================= ynh_print_info "Restoring the data directory..." -ynh_restore_file "/home/yunohost.app/$app" +datadir="/home/yunohost.app/$app" + +# The data directory will be restored only if it exists in the backup archive +# So only if it was backup previously. +if [ -d "$YNH_BACKUP_DIR/apps/$app/backup$datadir" ] +then + ynh_restore_file "$datadir" +else + # Create app folders + mkdir -p "$datadir"/{files,links,async,block} +fi #================================================= # RESTORE USER RIGHTS