Home > Back-end >  How can i download specified file from s3 bucket
How can i download specified file from s3 bucket

Time:12-15

I'm trying to download one file from my s3 bucket

I'm trying this command:

aws s3 sync %inputS3path% %inputDatapath% --include "20211201-1500-euirluclprd01-olX8yf.1.gz"

and I habve also tried_

aws s3 sync %inputS3path% %inputDatapath% --include "*20211201-1500-euirluclprd01-olX8yf.1*.gz"

but when command is executing, I'm get all file that's include folder

Folder looks like :

/2021/12/05
20211201-1500-euirluclprd01-olX8yf.1.gz
20211201-1505-euirluclprd01-olX8yf.1.gz

CodePudding user response:

You can use aws s3 cp to copy a specific file. For example:

aws s3 cp s3://bucketname/path/file.gz .

Looking at your variables, you could probably use:

aws s3 cp %inputS3path%/20211201-1500-euirluclprd01-olX8yf.1.gz %inputDatapath%
  • Related