1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/piwigo_ynh.git synced 2024-09-03 20:06:03 +02:00

Don't backup _data temporary folder (closes #17)

This commit is contained in:
Jimmy Monin 2018-01-20 17:25:14 +01:00
parent 091c3de0f8
commit 5a9b97a05d
2 changed files with 7 additions and 5 deletions

View file

@ -42,7 +42,7 @@ ynh_backup "$final_path"
backup_core_only=$(ynh_app_setting_get "$app" backup_core_only) 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 if [ -z $backup_core_only ] # If backup_core_only setting set, don't backup data directory
then then
ynh_backup /home/yunohost.app/${app} ynh_backup /home/yunohost.app/${app}/upload
else else
echo "Data dir won't be saved, because backup_core_only is set." >&2 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 # Remove the option so that next regular backup will be complete

View file

@ -54,12 +54,14 @@ ynh_restore_file "/etc/nginx/conf.d/$domain.d/$app.conf"
ynh_restore_file "$final_path" ynh_restore_file "$final_path"
# Restore data directory if backed-up # Restore data directory if backed-up
if [ -d "$YNH_BACKUP_DIR/apps/${app}/backup/home/yunohost.app/${app}" ] ; then if [ -d "$YNH_BACKUP_DIR/apps/${app}/backup/home/yunohost.app/${app}/upload" ] ; then
ynh_restore_file "/home/yunohost.app/${app}" ynh_restore_file "/home/yunohost.app/${app}/upload"
else else
# Create app folders # Create app data folder
mkdir /home/yunohost.app/${app}/_data /home/yunohost.app/${app}/upload mkdir /home/yunohost.app/${app}/upload
fi 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 # Remove the option backup_core_only if it's in the settings.yml file
ynh_app_setting_delete $app backup_core_only ynh_app_setting_delete $app backup_core_only