2016-07-08 2 views
2

〜/ x7/music/sfx
〜/ x7/musicのルートにいくつかのファイルとフォルダがあります
sfxフォルダのみを同期し、何も無視する必要がありますそれ以外は音楽。ユニゾン。 1つのサブフォルダ以外のディレクトリ内のすべてのファイルを無視する

多くの変形を試みましたが、すべてが間違っていました。

ignore = Name music/* 
ignorenot = Regex music/sfx/.* (OR just *) 

ですが、私はあなたが私はありませんその:)

答えて

1

で私を助ける場合、私は幸せになる

ignore = Name music/*^/ 

のようなものを使用して期待していた

動作しません。ユニゾンに精通していますが、使用できるsfx以外のものはすべて無視してください

ignore = Regex /root/path/to/music/.* 
ignorenot Regex /root/path/to/music/sfx/.* 
ユニゾンのマニュアルに従い

Documentation Source

There is also an ignorenot preference, which specifies a set of patterns for paths that should not be ignored, even if they match an ignore pattern. However, the interaction of these two sets of patterns can be a little tricky. Here is exactly how it works:

  • Unison starts detecting updates from the root of the replicas—i.e., from the empty path. If the empty path matches an ignore pattern and does not match an ignorenot pattern, then the whole replica will be ignored. (For this reason, it is not a good idea to include Name * as an ignore pattern. If you want to ignore everything except a certain set of files, use Name ?*.)

  • If the root is a directory, Unison continues looking for updates in all the immediate children of the root. Again, if the name of some child matches an ignore pattern and does not match an ignorenot pattern, then this whole path including everything below it will be ignored.

  • If any of the non-ignored children are directories, then the process continues recursively.

+0

残念ながら、あなたのソリューションは正しく動作していません。それはまだすべての音楽フォルダを同期しています。 このフォルダのみを同期することはできません.iisonは2つのソース(例:リモートとローカル)をサポートしているため、この特定の操作にregexのみを使用できます。 – det

+0

私は自分のドキュメントを見て、これを行う方法を説明し、私の答えを更新しました –

+0

_助けてくれてありがとう)_ この文字列は 'ignore = regex/home/det/x7/music /(? !sfx)。* *または(〜。/ x7/music ...) tells ** error **: '致命的なエラー:ファイル" x7 "、行33:不正なパターン" Regex/home/det/x7/music /((?! sfx)。)* "。" – det

0

特定のパスがそのように無視された場合、すべてがそれを怒鳴るん。したがって、サブフォルダ以外のフォルダ内のすべてを無視する場合は、そのフォルダ自体を無視するのではなく、その内部のすべてを無視してから、ignorenotを使用してください。

ignore = Path x7/music/?* 
ignore = Path x7/music/.?* 
ignorenot = Path x7/music/sfx 

これでいいはずです。

ここで使用されている特定の正規表現に関して、私はもう一度ユニゾンのドキュメンテーションのアドバイスに従っています: "この理由で、Name *を無視パターンとして含めることは良い考えではありません。ファイルのうち、Name ?*を使用してください。 2番目のignore行は、music内の隠しファイル/フォルダも無視します(必要な場合)。

関連する問題