Austin
Austin

Reputation: 7349

awscli s3 sync wildcards

I'm trying to sync all files in a directory that start with "model.ckpt" to an S3 bucket path, by trying this:

aws s3 sync ./model.ckpt* $S3_CKPT_PATH

But I'm getting the error:

Unknown options: ./model.ckpt-0.meta,<my S3_CKPT_PATH path>

However, aws s3 sync . $S3_CKPT_PATH works, but gives me a lot of additional files I don't want.

Anybody know how I can do this?

Upvotes: 16

Views: 13421

Answers (1)

John Rotenstein
John Rotenstein

Reputation: 270224

When using aws s3 sync, all files in a folder are included.

If you wish to specify wildcards, you will need to Use Exclude and Include Filters.

For example:

aws s3 sync mydir s3://bucket/folder/ --exclude "*" --include "model.ckpt*"

Upvotes: 44

Related Questions