I am trying to download certain files from S3 to local machine by running the following code:
import subprocess, os
ec2_root = '/home/'
s3_root_path = "S3://bucket-name/"
s3_download_command = ["aws", "s3", "cp", os.path.join(s3_root_path, 'my_video.mp4'), os.path.join(local_root)]
p = subprocess.Popen(s3_download_command)
p.communicate()
But I get the following error:
usage: aws s3 cp <LocalPath> <S3Uri> or <S3Uri> <LocalPath> or <S3Uri> <S3Uri> Error: Invalid argument type
It turned out that I used S3:// with a capital S instead of small s.
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