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

How to exclude file or directory? #538

Open
once375ml opened this issue May 17, 2024 · 6 comments
Open

How to exclude file or directory? #538

once375ml opened this issue May 17, 2024 · 6 comments

Comments

@once375ml
Copy link

The same issue from me: #536

I need command instruction. If I remove the space between "!" and path, it reports error.

Here are the command and screenshot:
/volume1/temp_dirs/imdl/imdl torrent create -S -P -p 4mib -a https://xyz.io/announce.php -i /volume1/iso/OMV -o /volume1/temp_dirs/imdl/omv.torrent -g ! /volume1/iso/OMV/openmediavault_6.0.24-amd64.iso

@casey
Copy link
Owner

casey commented May 18, 2024

I think the issue is that ! is a special character in the shell. Try putting them together and quoting them: -g '!/volume1/iso/OMV/openmediavault_6.0.24-amd64.iso'.

@casey casey closed this as completed May 18, 2024
@once375ml
Copy link
Author

I think the issue is that ! is a special character in the shell. Try putting them together and quoting them: -g '!/volume1/iso/OMV/openmediavault_6.0.24-amd64.iso'.

Still the same.

@casey
Copy link
Owner

casey commented May 19, 2024

What's the error?

@casey casey reopened this May 19, 2024
@once375ml
Copy link
Author

What's the error?

I had excluded the openmediavault_6.0.24-amd64.iso with your command instruction. You will see the exact command I input at the top of the screenshot.
But it produced the same torrent like I didn't exclude any file. You will also see the openmediavault_6.0.24-amd64.iso is in the torrent at the bottom of the screenshot.

@casey
Copy link
Owner

casey commented May 20, 2024

Hmmm, I honestly don't remember how exclusion patterns work. Does a relative path work, either -g! OMV/openmediavault_6.0.24-amd64.iso or -g!openmediavault_6.0.24-amd64.iso?

@ghost
Copy link

ghost commented Nov 12, 2024

I think the exclusion pattern is relative to the input, so in this case should be -g '!openmediavault_6.0.24-amd64.iso'

e.g. imdl torrent create -i test -g '!file2' excludes test/file2 while including test/file1 in testing.

On a related note, the exclusion examples in the FAQ were a bit confusing for me. It seemingly shows excluding directories as -g '!bar/', which I couldn't get to work in testing. After some trial and error, I realized using a wildcard accomplishes what I wanted. This makes sense with globbing, but it tripped me up when closely following the FAQ example (which I thought applied almost identically to my needs.)

e.g.

  • imdl torrent create -i test -g '!dir2/*' excludes test/dir2 and all of its files, while including test/dir1.
  • imdl torrent create -i test -g '!dir2/' doesn't exclude test/dir2
  • imdl torrent create -i test -g '!dir2' doesn't exclude test/dir2

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

No branches or pull requests

2 participants