diff --git a/scripts/backup b/scripts/backup index a949992..5fc2c74 100644 --- a/scripts/backup +++ b/scripts/backup @@ -42,7 +42,7 @@ ynh_backup "$final_path" backup_core_only=$(ynh_app_setting_get "$app" backup_core_only) if [ -z $backup_core_only ] # If backup_core_only setting set, don't backup data directory then - ynh_backup /home/yunohost.app/${app} + ynh_backup /home/yunohost.app/${app}/upload else echo "Data dir won't be saved, because backup_core_only is set." >&2 # Remove the option so that next regular backup will be complete diff --git a/scripts/restore b/scripts/restore index d6f1dc9..9fe54a6 100644 --- a/scripts/restore +++ b/scripts/restore @@ -54,12 +54,14 @@ ynh_restore_file "/etc/nginx/conf.d/$domain.d/$app.conf" ynh_restore_file "$final_path" # Restore data directory if backed-up -if [ -d "$YNH_BACKUP_DIR/apps/${app}/backup/home/yunohost.app/${app}" ] ; then - ynh_restore_file "/home/yunohost.app/${app}" +if [ -d "$YNH_BACKUP_DIR/apps/${app}/backup/home/yunohost.app/${app}/upload" ] ; then + ynh_restore_file "/home/yunohost.app/${app}/upload" else - # Create app folders - mkdir /home/yunohost.app/${app}/_data /home/yunohost.app/${app}/upload + # Create app data folder + mkdir /home/yunohost.app/${app}/upload fi +# Create temporary data folder +mkdir -p /home/yunohost.app/${app}/_data # Remove the option backup_core_only if it's in the settings.yml file ynh_app_setting_delete $app backup_core_only