From 748249566fbf7a699e19ba887026b69764e6c720 Mon Sep 17 00:00:00 2001 From: Maniack Crudelis Date: Thu, 2 Nov 2017 12:53:49 +0100 Subject: [PATCH 1/2] Fix restore with backup_core_only --- scripts/restore | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/restore b/scripts/restore index 6bc4987..cfc6511 100755 --- a/scripts/restore +++ b/scripts/restore @@ -102,12 +102,16 @@ ynh_restore_file "/etc/logrotate.d/$app" # RESTORE THE DATA DIRECTORY #================================================= +datadir="/home/yunohost.app/${app}/data" + # 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/data" ] then - datadir="/home/yunohost.app/${app}/data" ynh_restore_file "$datadir" +else + # Create app folders + mkdir -p "$datadir" fi # Remove the option backup_core_only if it's in the settings.yml file ynh_app_setting_delete $app backup_core_only From 8e0065fffe1d143ae34a1963a0daa39c813b499a Mon Sep 17 00:00:00 2001 From: Maniack Crudelis Date: Sun, 19 Nov 2017 18:45:50 +0100 Subject: [PATCH 2/2] Fix datadir test --- scripts/restore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/restore b/scripts/restore index cfc6511..71b0a30 100755 --- a/scripts/restore +++ b/scripts/restore @@ -106,7 +106,7 @@ datadir="/home/yunohost.app/${app}/data" # 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/data" ] +if [ -d "$YNH_BACKUP_DIR/apps/$app/backup/home/yunohost.app/$app" ] then ynh_restore_file "$datadir" else