Copy files recursively via SSH

Copy files recursively via SSH filtering with regex

Last update: 2023-10-05

This script will copy all folders and .json files to host from another pc recursively:

rsync -rav -e ssh --include '*/' --include='*.json' --exclude='*'\
[PC]:[SOURCE_FOLDER] [DESTINATION_FOLDER]

# PC = user@192.168.0.3
# SOURCE_FOLDER = /tmp/myfolder
# DESTINATION_FOLDER = /tmp