Quote:
Originally Posted by camerabambai
Solution found
a)use those options of rsync
b)never sync the dir "directly", for example
Code:
rsync -avAXHhSP /mnt/hd/bin/ remote: /mnt/hd/bin WRONG
rsync -avAXHhSP /mnt/hd/ remote: /mnt/hd OK
|
There is no difference in those 2 commands except the first one only copies the /mnt/hd/bin/ directory content while retaining the path, and the second copies all the content of the /mnt/hd/ directory.
The error is that your first command says copy the content of this source directory to this (non-existing) file. The second says copy the content of this source directory to this (existing) directory.
What is wrong about the first and correct about the second is that the destination directory must exist when using that syntax.
Changing the first command to read
Code:
rsync -avAXHhSP /mnt/hd/bin/ remote: /mnt/hd/bin/
would work as expected since that would create the missing directory before copying the files.
The same effect could be achieved with
Code:
rsync -avAXHhSP /mnt/hd/bin remote: /mnt/hd/
or
rsync -avAXHhSP /mnt/hd remote: /mnt/
Both these structures say copy this source directory and content into the destination directory.
Read the details of the rsync man page explanations of syntax to understand the differences.