Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exclude certain files #1579

Closed
sergeevabc opened this issue Apr 10, 2019 · 3 comments
Closed

Exclude certain files #1579

sergeevabc opened this issue Apr 10, 2019 · 3 comments

Comments

@sergeevabc
Copy link

Dear @facebook,
Imagine there is the following files tree, which is growing day by day.

C:\Logs
|-- 2019-04-08
|   `-- log01.txt
|-- 2019-04-09
|   `-- log02.txt
`-- 2019-04-10
    `-- log03.txt

To reduce the footprint, I command zstd --long --rm -r C:\Logs
then big .txt are replaced with small .txt.zst, so far so good.
But tomorrow the tree will obviously look like this

Logs
|-- 2019-04-08
|   `-- log01.txt.zst
|-- 2019-04-09
|   `-- log02.txt.zst
|-- 2019-04-10
|   `-- log03.txt.zst
`-- 2019-04-11
    `-- log04.txt

And here lies the crux as the aforementioned command will compress existing .txt.zst again.

Current workaround is find -type f -not -iname *.zst -exec zstd --long --rm {} +
or by means of fd by @sharkdp as follows fd -t f --exclude *.zst -x zstd --long --rm

However, some native exclude switch would be appropriate and appreciated,
e.g. zstd --exclude *.zst --long --rm -r C:\Logs

Do you agree?

@terrelln
Copy link
Contributor

I don't want to add glob match finding support to zstd. However a --exclude-suffix .zst or maybe --exclude-compressed which would ignore (.zst|.gz|.xz|.lz4|...) would be a useful feature.

@Cyan4973
Copy link
Contributor

T56236104 (internal note)

@Cyan4973
Copy link
Contributor

--exclude-compressed has been added to v1.4.4.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants