1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/wallabag2_ynh.git synced 2024-10-01 13:35:06 +02:00
This commit is contained in:
lapineige 2024-04-22 04:22:27 +02:00 committed by GitHub
commit 8ba5ae7b19
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

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