Reputation: 161
I want to upload multiple .gz files to an s3 bucket using a wildcard command. The command is:
/usr/bin/aws s3 mv /path/File-$(date -d "yesterday 13:00" '+%d-%m-%Y')-* s3://bucket/$(date -d "yesterday 13:00" '+year=\%Y/month=\%m/day=\%d')/filetype/ --recursive --exclude "*" --include "*.log.gz"
I've used the same command to upload other files to s3. But it doesn't seem to work in this case, as it threw a warning:
warning: Skipping file /path/File-03-03-2020-1.log.gz/. File does not exist.
It looks like the command is treating File-03-03-2020-1.log.gz
as a folder, not as a file. It's the same behavior to aws s3 sync
, but I think this is an incorrect behavior for aws s3 mv
.
Where did I go wrong?
Upvotes: 0
Views: 1941
Reputation: 176
Building on John's comment, for your scenario,
/usr/bin/aws s3 mv /path/ s3://bucket/$(date -d "yesterday 13:00" '+year=\%Y/month=\%m/day=\%d')/filetype/ --recursive --exclude "*" --include "File-$(date -d "yesterday 13:00" '+%d-%m-%Y')-*.log.gz"
would probably be the command.
Upvotes: 1