I
I
Ivan2019-10-19 15:02:25
linux
Ivan, 2019-10-19 15:02:25

How to make RSYNC copy all files and folders?

Hello comrades! Please tell me how to set up rsync correctly.
I'm trying to copy with this command, but only files are copied. Writes skipping directory test1
sudo rsync -zvh /home/user/documents/* /tmp/backups/
And you need files and folders.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
R
Ruslan Fedoseev, 2019-10-19
@martin74ua

man rsync
to understanding. Everything is written there

A
Artem @Jump, 2019-10-19
Tag

Remove the slash on the way to the source.

A
Alexey Kharchenko, 2019-10-20
@AVX

man rsync says:
Those. you need to remove the slash in the path so that subdirectories are created.
It is also written there that, for example, these commands will copy the same thing:

rsync -av /src/foo /dest
rsync -av /src/foo/ /dest/foo

There is a slash - no subdirectories are created, no slash - they are created.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question