Good morning, I want to transfer specific files in a directory to a remote machine while keeping the architecture of the subdirectories. Moreover, I only want to transfer files that have a peculiar extension (e.g. ".txt"). I have tried the following:
rsync -aP --include *.txt ./sourceDirectory user@hostIP:destDirectory
but it copies to the destination (destDirectory
) all the files, and not only those which match the .txt
pattern.
Could anybody help me with such riddle?
P.S.: obviously, the directory sourceDirectory
contains subdirectories where are located my .txt
files.