ALT Linux Community general discussions
 help / color / mirror / Atom feed
From: Andrey Savchenko <bircoph@altlinux.org>
To: ALT Linux Community general discussions <community@lists.altlinux.org>
Subject: Re: [Comm] Копирование файлов по типу
Date: Wed, 20 Oct 2021 21:32:27 +0300
Message-ID: <20211020213227.e4a3c079e2b46745c30f4f30@altlinux.org> (raw)
In-Reply-To: <04392f0f-dc10-f9e4-ca39-2192ee1e8982@tut.by>

[-- Attachment #1: Type: text/plain, Size: 1546 bytes --]

On Wed, 20 Oct 2021 13:44:43 +0300 А. Куликовский wrote:
> Добрый день.
> 
> Проблема: есть дерево каталогов со смесью файлов разных типов. Нужно 
> скопировать (перенести) все файлы только определённых типов в другое 
> место _с сохранением структуры каталогов_. Можно с консоли или в MC.
> 
> Где-то есть самописный FPC модуль обхода дерева, можно было бы дописать, 
> но должно быть и более разумное решение.

Для rsync можно сколь угодно сложную систему фильтров написать, что
позволяет как обойти ограничения критериев find (хотя они тоже
достаточно широкие), так и не возится с cp -l (хотя бы потому, что
это невозможно между разными файловыми системами). При этом можно
распорядится что делать с жесткими ссылками (сохранять или
копировать) и тонко настроить многие другие аспекты. См. FILTER
RULES и последующие разделы в man rsync.

Пример:

rsync -av --exclude '**.bak' src dst

Best regards,
Andrew Savchenko

[-- Attachment #2: Type: application/pgp-signature, Size: 833 bytes --]

      parent reply	other threads:[~2021-10-20 18:32 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-20 10:44 А. Куликовский
2021-10-20 11:06 ` Alexei Mezin
2021-10-20 11:14   ` Alexei Mezin
2021-10-20 11:24 ` Anton V. Boyarshinov
2021-10-20 15:56   ` Vladimir D. Seleznev
2021-10-20 18:32 ` Andrey Savchenko [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211020213227.e4a3c079e2b46745c30f4f30@altlinux.org \
    --to=bircoph@altlinux.org \
    --cc=community@lists.altlinux.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

ALT Linux Community general discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/community/0 community/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 community community/ http://lore.altlinux.org/community \
		mandrake-russian@linuxteam.iplabs.ru community@lists.altlinux.org community@lists.altlinux.ru community@lists.altlinux.com
	public-inbox-index community

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://lore.altlinux.org/org.altlinux.lists.community


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git