Synchronizing between Local Windows drive and AWS S3

Dipendra Dangal
1 min readJul 7, 2023

--

In this blog, I am going to explain, how to synchronize a local folder with AWS S3.

Prerequisites

  • AWS Access Key and Secret Access Key with S3 permission(see this doc for reference)
  • Installed AWS CLI in windows(see this doc for reference)

Step 1: Create a bucket in S3

Sign in the AWS console. Go to s3 and create a bucket.

Step 2: Create a batch file in local computer

Create a batch file e.g: s3backup.bat and edit it with your favorite text editor and add the following line:

aws s3 sync D:/folder1 s3://mybucket-name

Step 3: Configure Task Scheduler

  • Open Task Scheduler, create a new task and name it.
  • Go to the Actions in the same dialog box and create a new action. Give the path to the batch file and click on Ok.
  • Next, go to the trigger in the same dialog box and​ ​ create a new trigger.
  • Schedule the task to begin daily at a certain time period, also we check on Repeat task every 1 hour for a given duration of period and click on OK.

Step 4: Test the sync process

Now, add some files in the selected folder of your local computer and wait for the Task Scheduler to run the batch job. After task scheduler successfully runs the task, then the files should be displayed in the S3 bucket.

--

--