1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/wallabag2_ynh.git synced 2024-10-01 13:35:06 +02:00

[Backup core only] Do not backup image cache - First step

This commit is contained in:
lapineige 2022-11-22 18:08:20 +01:00 committed by Félix Piédallu
parent 4c2f0ef231
commit 65d4ee5aa0

View file

@ -13,6 +13,17 @@ source /usr/share/yunohost/helpers
#=================================================
ynh_print_info --message="Declaring files to be backed up..."
#=================================================
# APPLY BACKUP CORE ONLY POLICY
#=================================================
# Apply policy only if we are not in upgrade mode
BACKUP_CORE_ONLY=${BACKUP_CORE_ONLY:-auto}
if [ "$BACKUP_CORE_ONLY" == "auto" ] ; then
BACKUP_CORE_ONLY=$(ynh_app_setting_get --app="$app" --key="backup_core_only")
BACKUP_CORE_ONLY=${BACKUP_CORE_ONLY:-0}
fi
#=================================================
# BACKUP THE APP MAIN DIR
#=================================================
@ -20,7 +31,14 @@ ynh_print_info --message="Declaring files to be backed up..."
# Clean cache files before backup (saved some disk space)
ynh_secure_remove --file=$install_dir/var/cache/prod
ynh_backup --src_path="$install_dir"
if [ "$BACKUP_CORE_ONLY" ] ; then
ynh_print_warn --message="Backing up only the core... If you downloaded article images, they will not be saved."
mv "$install_dir/web/assets/images" "/tmp/$app/web/assets/images"
ynh_backup --src_path="$install_dir"
mv "/tmp/$app/web/assets/images" "$install_dir/web/assets/images"
else
ynh_backup --src_path="$install_dir"
fi
#=================================================
# BACKUP THE SYSTEM CONFIGURATION