mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
Merge pull request #398 from YunoHost/backup_core_only
[enh] Tranfer backup_core_only to BACKUP_CORE_ONLY
This commit is contained in:
commit
fc8537643b
2 changed files with 9 additions and 1 deletions
|
@ -46,6 +46,14 @@ 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
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Add table
Reference in a new issue