Leptonator
Leptonator

Reputation: 3499

rsync two folders in the same command

We know we can do the following and works fine:

rsync -avzh -e ssh --progress [email protected]:/home/folder1/ /home/downloads/
rsync -avzh -e ssh --progress [email protected]:/home/folder2/ /home/downloads/

However, is it possible to check two folders at the same time? For, example:

rsync -avzh -e ssh --progress [email protected]:/home/folder1/|/home/folder2/ /home/downloads/

Upvotes: 0

Views: 138

Answers (1)

Aaron
Aaron

Reputation: 24802

You can use bash expansion :

rsync -avzh -e ssh --progress [email protected]:/home/folder{1,2}/ /home/downloads/

Upvotes: 1

Related Questions