Table Of Contents

Feedback

User Guide

First time using the AWS CLI? See the User Guide for help getting started.

[ aws . datasync ]

create-task

Description

Creates a task. A task is a set of two locations (source and destination) and a set of Options that you use to control the behavior of a task. If you don't specify Options when you create a task, AWS DataSync populates them with service defaults.

When you create a task, it first enters the CREATING state. During CREATING AWS DataSync attempts to mount the on-premises Network File System (NFS) location. The task transitions to the AVAILABLE state without waiting for the AWS location to become mounted. If required, AWS DataSync mounts the AWS location before each task execution.

If an agent that is associated with a source (NFS) location goes offline, the task transitions to the UNAVAILABLE status. If the status of the task remains in the CREATING status for more than a few minutes, it means that your agent might be having trouble mounting the source NFS file system. Check the task's ErrorCode and ErrorDetail. Mount issues are often caused by either a misconfigured firewall or a mistyped NFS server host name.

See also: AWS API Documentation

See 'aws help' for descriptions of global parameters.

Synopsis

  create-task
--source-location-arn <value>
--destination-location-arn <value>
[--cloud-watch-log-group-arn <value>]
[--name <value>]
[--options <value>]
[--excludes <value>]
[--schedule <value>]
[--tags <value>]
[--cli-input-json <value>]
[--generate-cli-skeleton <value>]

Options

--source-location-arn (string)

The Amazon Resource Name (ARN) of the source location for the task.

--destination-location-arn (string)

The Amazon Resource Name (ARN) of an AWS storage resource's location.

--cloud-watch-log-group-arn (string)

The Amazon Resource Name (ARN) of the Amazon CloudWatch log group that is used to monitor and log events in the task.

For more information on these groups, see Working with Log Groups and Log Streams in the Amazon CloudWatch User Guide.

For more information about how to use CloudWatch Logs with DataSync, see Monitoring Your Task in the AWS DataSync User Guide.

--name (string)

The name of a task. This value is a text reference that is used to identify the task in the console.

--options (structure)

The set of configuration options that control the behavior of a single execution of the task that occurs when you call StartTaskExecution . You can configure these options to preserve metadata such as user ID (UID) and group ID (GID), file permissions, data integrity verification, and so on.

For each individual task execution, you can override these options by specifying the OverrideOptions before starting a the task execution. For more information, see the operation.

Shorthand Syntax:

VerifyMode=string,OverwriteMode=string,Atime=string,Mtime=string,Uid=string,Gid=string,PreserveDeletedFiles=string,PreserveDevices=string,PosixPermissions=string,BytesPerSecond=long,TaskQueueing=string

JSON Syntax:

{
  "VerifyMode": "POINT_IN_TIME_CONSISTENT"|"ONLY_FILES_TRANSFERRED"|"NONE",
  "OverwriteMode": "ALWAYS"|"NEVER",
  "Atime": "NONE"|"BEST_EFFORT",
  "Mtime": "NONE"|"PRESERVE",
  "Uid": "NONE"|"INT_VALUE"|"NAME"|"BOTH",
  "Gid": "NONE"|"INT_VALUE"|"NAME"|"BOTH",
  "PreserveDeletedFiles": "PRESERVE"|"REMOVE",
  "PreserveDevices": "NONE"|"PRESERVE",
  "PosixPermissions": "NONE"|"PRESERVE",
  "BytesPerSecond": long,
  "TaskQueueing": "ENABLED"|"DISABLED"
}

--excludes (list)

A list of filter rules that determines which files to exclude from a task. The list should contain a single filter string that consists of the patterns to exclude. The patterns are delimited by "|" (that is, a pipe), for example, "/folder1|/folder2"

Shorthand Syntax:

FilterType=string,Value=string ...

JSON Syntax:

[
  {
    "FilterType": "SIMPLE_PATTERN",
    "Value": "string"
  }
  ...
]

--schedule (structure)

Specifies a schedule used to periodically transfer files from a source to a destination location. The schedule should be specified in UTC time. For more information, see task-scheduling .

Shorthand Syntax:

ScheduleExpression=string

JSON Syntax:

{
  "ScheduleExpression": "string"
}

--tags (list)

The key-value pair that represents the tag that you want to add to the resource. The value can be an empty string.

Shorthand Syntax:

Key=string,Value=string ...

JSON Syntax:

[
  {
    "Key": "string",
    "Value": "string"
  }
  ...
]

--cli-input-json (string) Performs service operation based on the JSON string provided. The JSON string follows the format provided by --generate-cli-skeleton. If other arguments are provided on the command line, the CLI values will override the JSON-provided values. It is not possible to pass arbitrary binary values using a JSON-provided value as the string will be taken literally.

--generate-cli-skeleton (string) Prints a JSON skeleton to standard output without sending an API request. If provided with no value or the value input, prints a sample input JSON that can be used as an argument for --cli-input-json. If provided with the value output, it validates the command inputs and returns a sample output JSON for that command.

See 'aws help' for descriptions of global parameters.

Output

TaskArn -> (string)

The Amazon Resource Name (ARN) of the task.