Merge pull request #398 from YunoHost/backup_core_only

[enh] Tranfer backup_core_only to BACKUP_CORE_ONLY
This commit is contained in:
Alexandre Aubin 2018-03-15 17:32:39 +01:00 committed by GitHub
commit fc8537643b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 1 deletions

View file

@ -46,7 +46,15 @@ ynh_backup() {
local SRC_PATH="$1" local SRC_PATH="$1"
local DEST_PATH="${2:-}" local DEST_PATH="${2:-}"
local IS_BIG="${3:-0}" local IS_BIG="${3:-0}"
BACKUP_CORE_ONLY=${BACKUP_CORE_ONLY:-0}
# If backing up core only (used by ynh_backup_before_upgrade),
# don't backup big data items
if [ "$IS_BIG" == "1" ] && [ "$BACKUP_CORE_ONLY" == "1" ] ; then
echo "$SRC_PATH will not be saved, because backup_core_only is set." >&2
return 0
fi
# ============================================================================== # ==============================================================================
# Format correctly source and destination paths # Format correctly source and destination paths
# ============================================================================== # ==============================================================================

View file

@ -77,7 +77,7 @@ ynh_backup_before_upgrade () {
fi fi
# Create backup # Create backup
sudo yunohost backup create --ignore-system --apps $app --name $app_bck-pre-upgrade$backup_number --verbose sudo BACKUP_CORE_ONLY=1 yunohost backup create --ignore-system --apps $app --name $app_bck-pre-upgrade$backup_number --verbose
if [ "$?" -eq 0 ] if [ "$?" -eq 0 ]
then then
# If the backup succeeded, remove the previous backup # If the backup succeeded, remove the previous backup