Skip to content

Commit

Permalink
Merge pull request #1957 from orhtej2/fix_data_dir
Browse files Browse the repository at this point in the history
apps/helpers2.1: Properly detect 'is_data' (data dir or log folder) when calling ynh_backup
  • Loading branch information
alexAubin authored Oct 4, 2024
2 parents 43576d7 + f24ae34 commit 420e325
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions helpers/helpers.v2.1.d/backup
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ ynh_backup() {
local is_data=false

# If the path starts with /var/log/$app or $data_dir
if ([[ -n "${app:-}" ]] && [[ "$target" == "/var/log/$app*" ]]) || ([[ -n "${data_dir:-}" ]] && [[ "$target" == "$data_dir*" ]]); then
if ([[ -n "${app:-}" ]] && [[ "$target" =~ ^/var/log/$app/?\*?$ ]]) || ([[ -n "${data_dir:-}" ]] && [[ "$target" =~ ^$data_dir ]]); then
is_data=true
fi

Expand All @@ -43,7 +43,7 @@ ynh_backup() {
else
ynh_print_info "$target will not be saved, because 'do_not_backup_data' is set."
fi
return 1
return 0
fi

# ==============================================================================
Expand Down

0 comments on commit 420e325

Please sign in to comment.