Starting an AWS DataSync task with the AWS CLI - AWS DataSync

Beginning December 7, 2023, we will discontinue version 1 DataSync agents. Check the Agents page on the DataSync console to see if you have affected agents. If you do, replace those agents before then to avoid data transfer or storage discovery disruptions. If you need more help, contact AWS Support.

Starting an AWS DataSync task with the AWS CLI

You can begin transferring your data with AWS DataSync by using the AWS CLI.

To start your DataSync task, you just need to specify the Amazon Resource Name (ARN) of the task you want to run. Here's an example start-task-execution command:

aws datasync start-task-execution \ --task-arn 'arn:aws:datasync:region:account-id:task/task-id'

You can modify the task's settings for a specific task execution, as shown in the example following. For a description of these options, see Options. You also configure a specific task run to focus on specific files, folders, and objects to transfer. For more information, see Filtering data transferred by AWS DataSync.

The following example starts a task with a few settings that are different than the task's default settings:

aws datasync start-task-execution \ --override-options VerifyMode=NONE,OverwriteMode=NEVER,PosixPermissions=NONE

The command returns an ARN for your task execution similar to the following example:

{ "TaskExecutionArn": "arn:aws:datasync:us-east-1:209870788375:task/task-08de6e6697796f026/execution/exec-04ce9d516d69bd52f" }

Each agent can run a single task at a time.