![rysnc 파일 이름에 "_custom.conf" 또는 "_custom"이 포함된 모든 파일](https://linux55.com/image/174756/rysnc%20%ED%8C%8C%EC%9D%BC%20%EC%9D%B4%EB%A6%84%EC%97%90%20%22_custom.conf%22%20%EB%98%90%EB%8A%94%20%22_custom%22%EC%9D%B4%20%ED%8F%AC%ED%95%A8%EB%90%9C%20%EB%AA%A8%EB%93%A0%20%ED%8C%8C%EC%9D%BC.png)
파일 이름에 _custom.conf가 있는 파일만 동기화하거나 custom 또는 *.conf만 동기화할 수 있는 방법이 있습니까?
나는 연주했다
rsync -am --include='custom' --include='*/' --exclude='*' /etc/asterisk ~/backup
그리고
rsync -am --include='*custom*' --include='*/' --exclude='*' /etc/asterisk ~/backup
그리고
rsync -am --include='*.conf' --include='*/' --exclude='*' /etc/asterisk ~/backup
그러나 출력이 없다는 것을 발견했습니다.
답변1
이것은 나에게 효과적입니다
$ mkdir source
$ mkdir dest
$ cd source
$ touch a.conf b.conf b.noconf custom _custom.conf
$ ls
a.conf b.conf b.noconf custom _custom.conf
$ rsync -amv --include="custom" --include="*.conf" --exclude='*' ./ ../dest/
building file list ... done
./
_custom.conf
a.conf
b.conf
custom
sent 266 bytes received 91 bytes 238.00 bytes/sec
total size is 0 speedup is 0.00
$ ls ../dest
a.conf b.conf custom _custom.conf