

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

# 取消資料儲存庫任務
<a name="cancel-data-repo-task"></a>

您可以在資料儲存庫任務處於 PENDING 或 EXECUTING 狀態時取消該任務。當您取消任務時，會發生下列情況：
+ Amazon FSx 不會處理佇列中要處理的任何檔案。
+ Amazon FSx 會繼續處理目前正在處理的任何檔案。
+ Amazon FSx 不會還原任務已處理的任何檔案。

## 取消資料儲存庫任務 （主控台）
<a name="w2aac13c33c17c13b7b1"></a>

1. 開啟位於 https：//[https://console.aws.amazon.com/fsx/](https://console.aws.amazon.com/fsx/) 的 Amazon FSx 主控台。

1. 按一下您要取消資料儲存庫任務的檔案系統。

1. 開啟**資料儲存庫**索引標籤，然後向下捲動以檢視**資料儲存庫任務**面板。

1. 為您要取消的任務選擇**任務 ID** 或**任務名稱**。

1. 選擇**取消任務**以取消任務。

1. 輸入任務 ID 以確認取消請求。

## 取消資料儲存庫任務 (CLI)
<a name="w2aac13c33c17c13b7b3"></a>

使用 Amazon FSx [https://docs.aws.amazon.com/cli/latest/reference/fsx/cancel-data-repository-task.html](https://docs.aws.amazon.com/cli/latest/reference/fsx/cancel-data-repository-task.html) CLI 命令取消任務。 [https://docs.aws.amazon.com/fsx/latest/APIReference/API_CancelDataRepositoryTask.html](https://docs.aws.amazon.com/fsx/latest/APIReference/API_CancelDataRepositoryTask.html) 是對等的 API 命令。
+ 使用下列命令取消資料儲存庫任務。

  ```
  aws fsx cancel-data-repository-task \
      --task-id task-0123456789abcdef0
  ```

  如果命令成功，Amazon FSx 會以 JSON 格式傳回回應。

  ```
  {
      "Status": "CANCELING",
      "TaskId": "task-0123456789abcdef0"
  }
  ```