V
V
VA2017-07-03 16:42:54
linux
VA, 2017-07-03 16:42:54

How to copy hidden files (RSYNC)?

Hello
everyone I'm transferring letters to another server.
Hidden files and folders are not copied.
How to copy hidden files too
? user/.maildir/..

ls -1 /var/www/mailadmin/data/email/site.ru/ | while read u; do
rsync -avz -D -e ssh /var/www/mailadmin/data/email/site.ru/$u/.maildir/* [email protected]:/var/vmail/site.ru/$u/
done

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Saboteur, 2017-07-03
@Ozymandis

ls -1A lists "hidden" folders/files as well
man ls
-a, --all:
do not ignore entries starting with .
-A, --almost-all:
do not ignore entries starting with ., but not list implied . and ..
But in your case, you just need to copy without specifying *
rsync -avz -D -e ssh /var/www/mailadmin/data/email/site.ru/$u/.maildir [email protected]:/var /vmail/site.ru/$u

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question