Fix include filter: also include directory contents
When TARGET_INCLUDE has a directory pattern like 'embajada/', rsync would include the directory but exclude its contents (files didn't match any include rule before hitting --exclude=*). Now adds a 'pattern**' include for each directory pattern. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -188,7 +188,12 @@ transfer_folder() {
|
||||
for pat in "${inc_patterns[@]}"; do
|
||||
pat="${pat#"${pat%%[![:space:]]*}"}"
|
||||
pat="${pat%"${pat##*[![:space:]]}"}"
|
||||
[[ -n "$pat" ]] && filter_opts+=(--include="$pat")
|
||||
[[ -z "$pat" ]] && continue
|
||||
filter_opts+=(--include="$pat")
|
||||
# For directory patterns, also include their contents
|
||||
if [[ "$pat" == */ ]]; then
|
||||
filter_opts+=(--include="${pat}**")
|
||||
fi
|
||||
done
|
||||
filter_opts+=(--exclude="*")
|
||||
# Prune empty dirs left by directory traversal
|
||||
|
||||
Reference in New Issue
Block a user