Question about rsyncing to a slightly different folder structure on target

Wayne Davison wayned at
Wed Jan 1 12:02:35 MST 2014

On Tue, Dec 31, 2013 at 3:59 AM, Charles Marcus
<CMarcus at>wrote:

> On the old server, dovecot is configured to just use .../ the maildirs.
> On the target server, I want to change this to .../

One thing you can do is to add a symlink on the sending side to point the
Maildir to '.', and then run rsync with -R --no-implied-dirs and both the
normal top-level dir and a path down to the Maildir/ (with the trailing
slash) plus an exclude of the files in the user dir and the symlink itself.
 For instance:

mkdir -p /tmp/src/user
touch /tmp/src/user/{one,two,three}
ln -s . /tmp/src/user/Maildir
rsync -aivR --no-implied-dirs \
     --include='/src/user/Maildir/' --exclude='/src/user/Maildir/Maildir' \
     --exclude='/src/user/*' \
     /tmp/./src /tmp/./src/user/Maildir/ /tmp/dest/

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the rsync mailing list