meto
meto

Reputation: 3719

Save a file to a bucket using wget -P

I am currently connected with SSH in my E2 instance, and I have a S3 bucket.

I would like to save a file directly to the bucket, without having to save it to the instance and moving it in a second moment.

I tried

wget -P s3://my-bucket/folder web-address-of-the-file

what am I missing?

Upvotes: 0

Views: 876

Answers (1)

makhan
makhan

Reputation: 4009

wget saves to local drive, you can't save directly to S3. Even if you could, it would effectively have to stream through your instance, so the effect would be similar to saving locally and then moving to s3.

There are two things you can do:

  1. Save locally and then copy to S3 using AWS CLI or s3cmd wget web-address-of-the-file && aws s3 cp file s3://bucket/folder && rm file

  2. Mount your S3 bucket locally using something like s3fs and use wget -P /path/to/bucket address

Upvotes: 2

Related Questions