0

I have a ~50,000 I need to upload to an S3 bucket. These files already exist in Box.com Is there a way to write from Box to AWS using the AWSCLI? It just seems like a wasted step to download from Box, then upload to AWS.

aws s3 cp https://ky.box.com/shared/static/ijblogo31nhwrtr0woyiressfy0e86ss.laz  s3://kyfromabove/elevation/LAZ/Phase1/

The user-provided path https://ky.box.com/shared/static/ijblogo31nhwrtr0woyiressfy0e86ss.laz does not exist.
John Rotenstein
  • 241,921
  • 22
  • 380
  • 470
Ian Horn
  • 27
  • 4
  • How do you intend to download the files from box.com? Are the files publicly accessible, or do you need a login to access them? Based on [Download a folder from box using Terminal Command Line – Box Support](https://support.box.com/hc/en-us/community/posts/360049203113-Download-a-folder-from-box-using-Terminal-Command-Line), it would appear that you need to provide a TOKEN to prove that you are entitled to access the objects. See also: [java - Copy files from box folder to AWS s3 bucket - Stack Overflow](https://stackoverflow.com/questions/55778575/copy-files-from-box-folder-to-aws-s3-bucket) – John Rotenstein Jul 06 '23 at 22:03

1 Answers1

0

A pipe can help you solve this task! However, please do take note that AWS CLI will still download the file on your computer's memory instead of the file system!

curl -i -X GET \
  "https://ky.box.com/shared/static/ijblogo31nhwrtr0woyiressfy0e86ss.laz" \
  -H "Authorization: Bearer <ACCESS_TOKEN>" \
  | aws s3 cp - s3://ian-horn-bucket/file1.laz
Allan Chua
  • 9,305
  • 9
  • 41
  • 61
  • 1
    That sounds like a better option. Thank you. – Ian Horn Jul 06 '23 at 13:33
  • I ran a sample with the above syntax, not a whole lot going one. An empty file with the name '-' uploads. When I try to add the file name, I get the `file path not found` error. I still feel like a download to memory is best solution. – Ian Horn Jul 06 '23 at 19:40
  • Yes. I was able to download to memory and push to AWS. I'll provide a solution syntax. – Ian Horn Aug 22 '23 at 15:50