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 multiple directories when gsutil rsync? #771
Comments
Hi @zffocussss ! You can use the Here's more examples from the doc linked above:
Please let me know if that helps or if you have any other questions! |
Updated the comment above with a few more details specific to your question. :) |
Hi @catleeball ,I try it. |
Hi @zffocussss ! It looks like the issue might be with your regex. Here's an example I just tested: Given this local directory structure
Let's say we want to upload everything except
Now let's check and make sure the bucket looks like we want it to:
If it's helpful to you in writing your regex, I've found |
oh my god.thanks for your help.I know it is python regex.I used the pcre and shell regex. |
By the way,how do you test this regex format as they are in the path of the linux.they are not string. |
Hi @zffocussss ! When https://github.com/GoogleCloudPlatform/gsutil/blob/master/gslib/commands/rsync.py#L745 If you open the Python REPL, you can test your regex with something like this:
Or if you're using the online regex tester, you can plug in different directories and see which ones match or don't. 🙂 I hope that helps! Please let me know if you have any other questions @zffocussss ! |
It's also worth making use of the rsync command's |
Smart thinking, @houglum ! 💡 |
okay.I see.thanks. |
so nice advice.I can use this to see what will happen |
r=re.compile('^./dirA/. Regex matches: rsync-test/dirA I may find what I want.I need to consider "/",as it is a subdirectory. |
I have some sub directories a b c under directory "d"
how can I exclude them once?
The text was updated successfully, but these errors were encountered: