V
V
Vyacheslav Kordienko2017-01-30 12:45:13
linux
Vyacheslav Kordienko, 2017-01-30 12:45:13

How to exclude the creation of a folder when copying, but copy its contents (RSYNC)?

Hi all!
I transfer the mail server, transferred users with passwords, it remains to transfer folders with letters.
I ran into a problem, on the new server the letters are like this:
/var/vmail/domain/user/
On the old one like this: There are
/var/vmail/domain/user/.maildir/
about 200 boxes.
How to transfer folders so that /.maildir folder is not created on the new server, but its contents go directly to /var/vmail/domain/user/ ?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey Burov, 2017-01-30
@AmonTobin

More or less like this

ls -1 /var/vmail/domain/ | while read u; do
rsync /var/vmail/domain/$u/.maildir/* [email protected]:/var/vmail/domain/$u/
done

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question