rsync сохранить определенную папку с ее содержимым и структурой, исключить любые файлы вне папки

Насколько я помню, это автоматически -генерируемое имя сети, если вы явно не называете эту сеть. Вы можете найти в файле /usr/samples/tcpip/networksпример файла о сетевых именах в AIX.

Вот выдержка из документации AIX (7.1):Описание

The /etc/networks file contains information about the known networks that comprise the DARPA Internet. Each network is represented by a single line in the networks file. The format for the entries in the networks file is:

Name Number Aliases

The fields are described as follows: Item Description Name Specifies an official network name. Number Specifies a network number. Aliases Specifies any unofficial names used for the network.

Items on a line are separated by one or more spaces or tab characters. Comments begin with a # (pound sign). Routines that search the networks file do not interpret characters from the beginning of a comment to the end of that line. Network numbers are specified in dotted-decimal notation. A network name can contain any printable character except a field delimiter, new-line character, or comment character.

The networks file is normally created from the official network database maintained at the Network Information Center (NIC). The file can be modified locally to include unofficial aliases or unknown networks.This file is part of TCP/IP in Network Support Facilities.

Изменить :Таким образом, это один и тот же интерфейс, один и тот же маршрут, одна и та же сеть

1

en0   65390 link#2      e2.f9.3a.a8.fc.2     1205     0       71     0     0

и 2

en0   65390 10.140.128  nix-aix71-vs02-v     1205     0       71     0     0

0
22.04.2020, 19:56
2 ответа

От человека:

if the pattern contains a / (not counting a trailing /), then it is matched against the full pathname, including any leading directories.

Попробуйте,

 rsync -av --include='/' --include='/subfolder**' --exclude='*' source/ destination/
0
19.03.2021, 02:26

Вы можете избежать потенциальной сложности --includeи --exclude, используя относительные пути для указания исходного набора файлов, который вы хотите скопировать

Сценарий

Мы создаем ваш примерный каталог и файловую структуру в самом верхнем каталоге src. Мы будем копировать выделение в самый верхний каталог dst

.
mkdir -p src/folder{1,2,3}/{subfolder,other_subfolders} dst
touch src/folder{1,2,3}/subfolder/contents src/{folder{1,2,3}/,}file{1,2}
find src | LC_ALL=C sort

rsync --dry-run -avR src/./folder*/*/* dst/

Выход(изrsync)

sending incremental file list
folder1/
folder1/subfolder/
folder1/subfolder/contents
folder2/
folder2/subfolder/
folder2/subfolder/contents
folder3/
folder3/subfolder/
folder3/subfolder/contents

/./отмечает точку, в которой оставшаяся часть исходного пути должна использоваться в пункте назначения. Удалите --dry-run, чтобы он выполнял выбранные операции.

0
19.03.2021, 02:26

Теги

Похожие вопросы