Skip to content

Commit 0c56633

Browse files
committed
fix dump pattern usage in db-restore-collections.sh
1 parent cc43fa6 commit 0c56633

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

render-ws-with-mongo-db/db-restore-collections.sh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,12 @@
33
# ----------------------------------------------------------------------------
44
# Usage: db-restore-collection.sh [DUMP_PATTERN]
55
#
6+
# Example DUMP_PATTERNS are: 'par.*s70', 'match.*s115', 'align.*s90', 'ic2d.*s080'
7+
#
68
# Restore dump files to the mongodb database running on the current Google Cloud VM container.
79
#
8-
# You will be prompted to select one or more dump directories within
10+
# If you do not specify a dump pattern,
11+
# you will be prompted to select one or more dump directories within
912
# /mnt/disks/mongodb_dump_fs/dump/janelia
1013
#
1114
# Dump directories have the pattern:
@@ -112,8 +115,7 @@ matches=()
112115
if $PATTERN_IS_ARG; then
113116
# Argument is a free-form substring — match anywhere in the path
114117
while IFS= read -r d; do matches+=("$d"); done < <(
115-
find "$BASE_DUMP_DIR" -mindepth 5 -maxdepth 5 -type d \
116-
| grep -F "$DUMP_PATTERN" | sort)
118+
find "$BASE_DUMP_DIR" -mindepth 5 -maxdepth 5 -type d | grep "$DUMP_PATTERN" | sort)
117119
elif [[ -n "${glob_patterns[*]}" ]]; then
118120
# One or more glob patterns built interactively
119121
while IFS= read -r d; do matches+=("$d"); done < <(

0 commit comments

Comments
 (0)