Skip to content

Instantly share code, notes, and snippets.

@Babatunde13
Created July 11, 2024 16:42
Show Gist options
  • Select an option

  • Save Babatunde13/076a452faa6cbec0ab6f04a3e504f16f to your computer and use it in GitHub Desktop.

Select an option

Save Babatunde13/076a452faa6cbec0ab6f04a3e504f16f to your computer and use it in GitHub Desktop.

Revisions

  1. Babatunde13 revised this gist Jul 11, 2024. No changes.
  2. Babatunde13 created this gist Jul 11, 2024.
    20 changes: 20 additions & 0 deletions s3.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,20 @@
    #!bin/bash

    # This script will create a bucket in S3 and upload a file to it
    aws s3 mb s3://bkoiki950assets

    echo "Bucket created"

    echo "THis is my first file in index" >> index.txt
    echo "THis is another file in index1" >> index1.txt
    echo "THis is another file in index2" >> index2.txt

    aws s3 cp index.txt s3://bkoiki950assets
    aws s3 cp index1.txt s3://bkoiki950assets
    aws s3 cp index2.txt s3://bkoiki950assets

    aws s3 sync . s3://bkoiki950assets # This will sync all files in the current directory to the bucket

    echo "Files uploaded"

    aws s3 ls s3://bkoiki950assets