Download Recordings through AWS-CLI

Modified on Wed, Oct 22, 2025 at 1:43 PM

Steps to Sync .wav Recordings from One S3 Bucket to Another (or local folder) Using AWS CLI:



What is Sync in AWS s3?

The aws s3 sync command in the AWS Command Line Interface (CLI) is used to synchronize the contents of a local directory with an Amazon S3 bucket, or between two S3 buckets.



1. Install AWS CLI (if not already installed):

If you haven't already installed the AWS CLI, follow the official guide to install it:


2. Configure AWS CLI with Your AWS Credentials:

Before using the AWS CLI, you need to configure it with your AWS credentials. This ensures the CLI has the necessary permissions to interact with your AWS resources.

Run the following command in your terminal to start the configuration:

aws configure


You will be prompted to enter your AWS credentials and default region. Here’s what you’ll need to enter:

  • AWS Access Key ID: This is your access key. (To get it, go to the IAM Console, click on "Users," and generate an Access Key for your user).

  • AWS Secret Access Key: This is the secret key associated with your Access Key ID.

  • Default region name: Enter your preferred region, e.g., us-east-1, us-west-2, etc.

  • Default output format: Choose wav as the output format.

Example:

aws configure
AWS Access Key ID [None]: <Your-Access-Key-ID>
AWS Secret Access Key [None]: <Your-Secret-Access-Key>
Default region name [None]: us-east-1
Default output format [None]: wav


3. Example Command to Sync Specific .wav Files:

Now that your AWS CLI is configured, use the following command to sync specific .wav files between your S3 buckets. Here, we’ll sync two files: 0_2151306162@192.168.1.26-FF40.wav and 0_4115027317@192.168.1.26-09E8.wav.

  • First Example:
    aws s3 sync s3://my-source-bucket s3://my-destination-bucket --exclude "*" --include "0_2151306162@192.168.1.26-FF40.wav"
    This command:

    • Excludes all files (--exclude "*") initially.

    • Includes only the specific file 0_2151306162@192.168.1.26-FF40.wav (--include "0_2151306162@192.168.1.26-FF40.wav"), syncing only this particular .wav file from the source bucket to the destination bucket.


  • Second Example:
    aws s3 sync s3://my-source-bucket s3://my-destination-bucket --exclude "*" --include "0_2151306162@192.168.1.26-FF40.wav" --include "0_4115027317@192.168.1.26-09E8.wav"

    In this command:

    • You can repeat the --include option to specify multiple files to sync.

    • Excludes all files initially (--exclude "*") and then includes the specific files you want by repeating the --include option.

aws s3 sync s3://my-source-bucket s3://my-destination-bucket(or local folder) --exclude "*" --include "0_2151306162@192.168.1.26-FF40.wav" --include "0_4115027317@192.168.1.26-09E8.wav"


Note: --exclude "*" is a wildcard that matches every file, effectively excluding all files unless further patterns are specified with --include. You can repeat the --include option multiple times for syncing different files.

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article