Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not backup image cache - Implement Backup core only #160

Draft
wants to merge 1 commit into
base: testing
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion scripts/backup
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,32 @@ 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
#=================================================

# 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
Expand Down