I wanted to recursively move all file names matching "EU_GR" to EU/ folder
My folder structure before the query was run:
In /test/customers/
EU_GR...csv
EU_IT...csv
old/
|
|
-> EU_GR...csv
EU_GI...csv
EU/ -> Folder I want to move files to (from old/ as well)
Command I ran
aws s3 mv s3://test/customers/ s3://test/customers/EU/ --recursive --exclude "*" --include "*EU_GR*"
This was what it produced, it move all these files to here, but it kept doing it recursively, and it wouldn't end. It created the folder EU/ multiple times (4 times), before I stopped it.
EU/EU/EU/EU/
|
|
-> EU_GR...csv
EU_GR...csv
EU_GR...csv
EU_GR...csv
EU_GR...csv
Can someone explain to me what happened please? I only wanted to move the matching files up one folder. I'm guessing I messed up somewhere with the recursive and it kept looking at every folder (including EU/) and thus always matching with EU_GR?
The command is recursively moving the contents that are moved into s3://test/customers/EU/
also.
Try,
aws s3 mv s3://test/customers/ s3://test/customers/EU/ --recursive --exclude "*" --include "*EU_GR*" --exclude "*/EU/*"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With