Using CLI using aws cli
Tip
When uploading data from your local machine to the cloud, it's crucial to organize your data effectively. This will make it much easier to locate your files when you need them.
Prerequisites
Contact Support
Before you begin, contact Via Scientific support at support@viascientific.com to obtain:
- Bucket Name You'll need this to know where to upload data.
- AWS Credentials AWS Access Key and Secret Key. We'll use these later to upload.
Install aws cli
Install AWS CLI following the instructions here.
Step-by-Step
-
Configure AWS CLI:
- Open your terminal or command prompt.
- Run the following command to configure your AWS CLI with the credentials provided by support:
aws configure - Enter the Access Key ID, Secret Access Key, and region when prompted.
- Set
us-east-1as the region - Example configuration:
AWS Access Key ID [None]: <ACCESS KEY> AWS Secret Access Key [None]: <SECRET ACCESS KEY> Default region name [None]: us-east-1 Default output format [None]:
-
Prepare Your Data:
- Organize them in a directories on your local machine.
- The organization on your local machine will match the organization on AWS
-
Upload Data to S3 Bucket:
- Use the
aws s3 cpcommand to upload a single file. Replace<bucket-name>with the bucket name provided by support and<file-path>with the path to your data file or directory. - For a single file:
aws s3 cp <file-path> s3://<bucket-name>/ - Use the
aws s3 synccommand to upload all files within the directory, retaining the directory structure starting with<directory-path>:aws s3 sync <directory-path> s3://<bucket-name>/ --recursive
- Use the
-
Verify Upload:
- List the contents of your S3 bucket to verify that your files have been uploaded successfully:
aws s3 ls s3://<bucket-name>/ aws s3 ls s3://<bucket-name>/<directory-path>
- List the contents of your S3 bucket to verify that your files have been uploaded successfully: