Get the App
SLTechnology News&Howtos  ›  Servers  › 

Rsync maintains the original directory nesting relationship to synchronize files

Shulou Source: shulou.com Published: 2022-06-03 00:54:13 09月22日 Update

rsync -R is a parameter that maintains the nesting of the original directory.

For example, there is an absolute path/root/test/3/4/5/6/7, now

If you want to copy directory 4 and all the contents contained in directory 3 to/tmp/oldfile/while maintaining the nesting relationship of the original directory, cd to directory 3 first, and then execute rsync -avuzRP 4 /tmp/oldfile/.

This applies mainly to cases where there are too many directories in a directory that you don't need, and there are too many directories in a directory nest, and eventually a file, and what you need is not just that file, but the complete directory nesting.

Tags: Directories files contents parameters just case copy but path application synchronization Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Technology Apple MySQL MariaDB vpn