Skip hidden files in consumedir

This commit is contained in:
Eike Kettner 2020-11-23 23:00:05 +01:00
parent 67d2e93c4d
commit 631e6abbfd

View File

@ -354,13 +354,13 @@ checkSetup() {
checkSetup checkSetup
if [ "$once" = "y" ]; then if [ "$once" = "y" ]; then
info "Uploading all files in '$watchdir'." info "Uploading all files (except hidden) in '$watchdir'."
MD="-maxdepth 1" MD="-maxdepth 1"
if [ "$recursive" = "y" ]; then if [ "$recursive" = "y" ]; then
MD="" MD=""
fi fi
for dir in "${watchdir[@]}"; do for dir in "${watchdir[@]}"; do
find "$dir" $MD -type f -print0 | while IFS= read -d '' -r file; do find "$dir" $MD -type f -not -name ".*" -print0 | while IFS= read -d '' -r file; do
process "$file" "$dir" process "$file" "$dir"
done done
done done
@ -371,9 +371,13 @@ else
fi fi
$INOTIFY_CMD $REC -m --format '%w%f' -e close_write -e moved_to "${watchdir[@]}" | $INOTIFY_CMD $REC -m --format '%w%f' -e close_write -e moved_to "${watchdir[@]}" |
while read pathfile; do while read pathfile; do
dir=$(findDir "$pathfile") if [[ "$(basename "$pathfile")" != .* ]]; then
trace "The file '$pathfile' appeared below '$dir'" dir=$(findDir "$pathfile")
sleep 1 trace "The file '$pathfile' appeared below '$dir'"
process "$(realpath "$pathfile")" "$dir" sleep 1
process "$(realpath "$pathfile")" "$dir"
else
trace "Skip hidden file $(realpath "$pathfile")"
fi
done done
fi fi