rsync has a large number of options to control selecting files based on glob-like patterns. For example, --include-from=~/restore-pattern.txt
and the file might contain new line delimited patterns with just enough to identify the files:
/media/bak/bim/daily.5/CURRENT JOBS/17/17142**02-15-2018**500 ECR - B2 - BS 1.8.18 - Civil Set.pdf
As rsync reads the file, it does not need to be safe for the shell. Note **
matches slash, which is convenient but confirm this matches only what you want.
Unfortunately, POSIX-like environments have no consistent way of doing file names correctly. See David Wheeler's Filenames and Pathnames in Shell: How to do it Correctly for the annoying details. In particular, null is the only character guaranteed to not be in a path name. Most shell scripts do not handle this, they will break in the corner case of input file names with new lines in them.
Null-separated pathnames are one way to maximize the file names accepted by tools. With GNU findutils and rysnc, could use find -print0
to write out a list of file names, then rsync --from0 --files-from=
to transfer those files. When doing restores, saving the exact file list may be useful for future reference.