Rsync pull from /home/*/ to same dir

Running the following command:

/usr/bin/rsync -avuz --rsh=ssh --temp-dir=/tmp --port=55556 --rsync-path=/usr/bin/rsync REMOTEIP:/home/*/mail/ /home/*/mail > /var/log/rsync/test.log 2>&1

Results in rsync: mkdir "/home/*/mail" failed: No such file or directory (2)

Is there anyway to use the expanded path on the local side to get username instead of the literal *?

I want to only pull mail directory from all home dirs


You can only have one target directory. In your case, the common target is /home or /. So to get the remote path duplicated in the local target use the -R option:

... -R REMOTEIP:/home/*/mail/ /

You may like to add --no-implied-dirs to this to avoid rsync trying to copy attributes for the given directories (but not any subdirectories). Check first with -n to ensure this will do what you expect.

Category: rsync Time: 2016-07-28 Views: 0
Tags: rsync

Related post

iOS development

Android development

Python development

JAVA development

Development language

PHP development

Ruby development


Front-end development


development tools

Open Platform

Javascript development

.NET development

cloud computing


Copyright (C), All Rights Reserved.

processed in 0.137 (s). 12 q(s)