mc mirror --exclude seems not to be working on windows
Expected behavior
excluding folder when uploading actually idk if it's actually only listing then excluding or both
Actual behavior
not excluding
Steps to reproduce the behavior
C:\Users\User>mc.exe mirror --exclude "AppData\*" . windows-pc/backup/
0 B / ? [ =]
mc.exe: <ERROR> Failed to perform mirroring Insufficient permissions to access this file `C:\Users\User\AppData\Local\ElevatedDiagnostics`
mc --version
- (paste output of
mc --version) mc version RELEASE.2022-05-04T06-07-55Z
System information
windows 10
It looks like you and I are attempting to do the same thing, which is exclude using a prefix. See example 9 in the help:
09. Mirror a bucket from aliased Amazon S3 cloud storage to a local folder.
Exclude all .* files and *.temp files when mirroring.
mc mirror --exclude ".*" --exclude "*.temp" s3/test ~/test
This makes me believe that --exclude is operating on the "filename" portion of the path, but the docs are unclear, in my opinion. I did some testing on my own and found that when I changed the filter to something that occurred in the filename, the object was excluded, so I believe that prefix-based exclusion is not the point of this flag. I'd love for there to be something like a --exclude-prefix, that would be super helpful.
Is there any update on this? Seems the --exclude only works on files however when backing up some python projects I want to exclude all the directories that are not needed such as .git and pycache and the exclude commands doesn't work on folders
This command doesn't filter any of the folders
mc mirror --exclude ".*" --exclude "venv" --exclude "*pycache*" --exclude "*-info" "E:\Python Projects" s3/work_backup
MC Version:
mc version RELEASE.2022-08-23T05-45-20Z (commit-id=07fffc3bc88f70a73c3714d9af23122f611b76cf) Runtime: go1.18.5 windows/amd64 Copyright (c) 2015-2022 MinIO, Inc. License GNU AGPLv3 <https://www.gnu.org/licenses/agpl-3.0.html>
This issue has been automatically marked as stale because it has not had recent activity. It will be closed after 21 days if no further activity occurs. Thank you for your contributions.
I can confirm this is still an issue. I'm unable to specify a directory to exclude using either the dir or dir/* syntax.
First mirror of the directory excluding tmp
Then I removed tmp recursively to ensure it didn't exist, then tried again with --exclude tmp/*
Further experimentation seems to reveal --exclude is not functional with file names or specific paths to files either
Also tried removing --remove and enclosing the path in quotes just in case those might be factors, but saw the same behavior
FWIW I think the ability to parse an ignore file would be the most useful for excluding files. For example if .mcignore exists in the source, exclude all matching files using the same rules as git follows for .gitignore.
mc version:
mc version RELEASE.2024-01-05T05-04-32Z (commit-id=59eca9fea8984adec1e8e7a1c95d0ea23107ceff)
Runtime: go1.21.5 darwin/amd64
Copyright (c) 2015-2024 MinIO, Inc.
License GNU AGPLv3 <https://www.gnu.org/licenses/agpl-3.0.html>
fix via #4825