rsync仅限某些类型的文件

时间:2018-05-29 18:01:38

标签: linux bash shell rsync

我知道有关于此问题的讨论很多,但我没有找到具体的内容。 我试图复制/ home / /目录

中的所有 .key文件

这不起作用

/usr/bin/rsync -auPA --include="*/*.key" --exclude="*" /home/* /tmp/test

这有效,但它会复制不需要的空目录,例如/ home / uname / Documents

/usr/bin/rsync -auPA --include="*/" --include="*.key" --exclude="*" /home /tmp/test

基本上我需要rsync做的是只复制带.key扩展名的文件,只创建必须包含.key文件的文件夹

1 个答案:

答案 0 :(得分:2)

我认为您正在寻找user@computer ~ $ python -m pip install --user --upgrade pyscf Collecting pyscf Exception: Traceback (most recent call last): File "/usr/lib64/python2.7/site-packages/pip/basecommand.py", line 211, in main status = self.run(options, args) File "/usr/lib64/python2.7/site-packages/pip/commands/install.py", line 294, in run requirement_set.prepare_files(finder) File "/usr/lib64/python2.7/site-packages/pip/req/req_set.py", line 334, in prepare_file s functools.partial(self._prepare_file, finder)) File "/usr/lib64/python2.7/site-packages/pip/req/req_set.py", line 321, in _walk_req_to _install more_reqs = handler(req_to_install) File "/usr/lib64/python2.7/site-packages/pip/req/req_set.py", line 461, in _prepare_fil e req_to_install.populate_link(finder, self.upgrade) File "/usr/lib64/python2.7/site-packages/pip/req/req_install.py", line 250, in populate _link self.link = finder.find_requirement(self, upgrade) File "/usr/lib64/python2.7/site-packages/pip/index.py", line 486, in find_requirement all_versions = self._find_all_versions(req.name) File "/usr/lib64/python2.7/site-packages/pip/index.py", line 404, in _find_all_versions index_locations = self._get_index_urls_locations(project_name) File "/usr/lib64/python2.7/site-packages/pip/index.py", line 378, in _get_index_urls_lo cations page = self._get_page(main_index_url) File "/usr/lib64/python2.7/site-packages/pip/index.py", line 818, in _get_page return HTMLPage.get_page(link, session=self.session) File "/usr/lib64/python2.7/site-packages/pip/index.py", line 949, in get_page trusted=link.trusted, File "/usr/lib64/python2.7/site-packages/pip/index.py", line 866, in __init__ namespaceHTMLElements=False, File "/home/user/.local/lib64/python2.7/site-packages/html5lib/html5parser.py", line 47, in parse return p.parse(doc, **kwargs) File "/home/user/.local/lib64/python2.7/site-packages/html5lib/html5parser.py", line 289, in parse self._parse(stream, False, None, *args, **kwargs) File "/home/user/.local/lib64/python2.7/site-packages/html5lib/html5parser.py", line 130, in _parse self.tokenizer = _tokenizer.HTMLTokenizer(stream, parser=self, **kwargs) File "/home/user/.local/lib64/python2.7/site-packages/html5lib/_tokenizer.py", line 36, in __init__ self.stream = HTMLInputStream(stream, **kwargs) File "/home/user/.local/lib64/python2.7/site-packages/html5lib/_inputstream.py", line 151, in HTMLInputStream return HTMLBinaryInputStream(source, **kwargs) TypeError: __init__() got an unexpected keyword argument 'encoding' 选项。从手册页:

-m