Manage transfers

Stay organized with collections Save and categorize content based on your preferences.

This page shows you how to manage existing transfer jobs and operations.

To create a new transfer job, refer to Create transfers.

Edit a transfer configuration

You can edit the following properties of an existing transfer:

  • The transfer job's description
  • Microsoft Azure Blob Storage or Amazon S3 source credentials
  • Any filters applied to the transfer job
  • Options to overwrite or delete files
  • The transfer job's schedule

gcloud CLI

To edit an existing transfer configuration, use the gcloud transfer jobs update command.

gcloud transfer jobs update \
  JOB_NAME \
  [options]

Where:

  • JOB_NAME is the unique name of the job to update.

  • The options that can be updated are listed by running gcloud transfer jobs update --help.

For example, to update the source and destination of a job, and to remove its description, run the following command:

gcloud transfer jobs update \
  JOB_NAME \
  --source=gs://new-bucket-1 \
  --destination=gs://new-bucket-2 \
  --clear-description

Google Cloud console

To edit a transfer job, do the following:

  1. In the Google Cloud console, go to the Storage Transfer Service page.

    Go to Storage Transfer Service

  2. Click the transfer job's description. The Job details page is displayed.

  3. Click Configuration. The transfer job configuration is displayed.

  4. To change an item, click Edit next to the item.

  5. To start a job with the edits, click Start a run.

Run a transfer job from an existing configuration

You can run an existing transfer job. This allows you to start jobs that have no schedule, or to start a job outside of its schedule.

gcloud CLI

To run a transfer from an existing configuration, use gcloud transfer jobs run:

gcloud transfer jobs run JOB_NAME

The optional --no-async flag can be specified to block other tasks in your terminal until the transfer operation has completed.

Google Cloud console

To run a transfer from an existing configuration, do the following:

  1. In the Google Cloud console, go to the Storage Transfer Service page.

    Go to Storage Transfer Service

  2. Click the transfer job's description. The Job details page is displayed.

  3. To start a transfer job, click Start a run.

Monitor a transfer job

gcloud CLI

To monitor the progress of a job in real time, use gcloud transfer jobs monitor.

gcloud transfer jobs monitor JOB_NAME

The response shows the current operation, the job start time, and the amount of data transferred. Skipped bytes and errors are also counted.

Client libraries

A TransferJob resource is returned when you use transferJobs.create.

You can check the transfer's status after creating the job using transferJobs.get. If the transfer job's operation has started, this returns a TransferJob containing a populated latestOperationName field. Otherwise, if the transfer job's operation hasn't started, the latestOperationName field is empty.

To check a transfer job's status

REST

Request using transferJobs get:
GET https://storagetransfer.googleapis.com/v1/{jobName="name"}

Java

Looking for older samples? See the Storage Transfer Service Migration Guide.


import com.google.longrunning.Operation;
import com.google.storagetransfer.v1.proto.StorageTransferServiceClient;
import com.google.storagetransfer.v1.proto.TransferProto.GetTransferJobRequest;
import com.google.storagetransfer.v1.proto.TransferTypes.TransferJob;
import com.google.storagetransfer.v1.proto.TransferTypes.TransferOperation;
import java.io.IOException;

public class CheckLatestTransferOperation {

  // Gets the requested transfer job and checks its latest operation
  public static void checkLatestTransferOperation(String projectId, String jobName)
      throws IOException {
    // Your Google Cloud Project ID
    // String projectId = "your-project-id";

    // The name of the job to check
    // String jobName = "myJob/1234567890";

    StorageTransferServiceClient storageTransfer = StorageTransferServiceClient.create();

    // Get transfer job and check latest operation
    TransferJob transferJob =
        storageTransfer.getTransferJob(
            GetTransferJobRequest.newBuilder().setJobName(jobName).setProjectId(projectId).build());
    String latestOperationName = transferJob.getLatestOperationName();

    if (!latestOperationName.isEmpty()) {
      Operation operation = storageTransfer.getOperationsClient().getOperation(latestOperationName);
      TransferOperation latestOperation =
          TransferOperation.parseFrom(operation.getMetadata().getValue());

      System.out.println("The latest operation for transfer job " + jobName + " is:");
      System.out.println(latestOperation.toString());

    } else {
      System.out.println(
          "Transfer job "
              + jobName
              + " hasn't run yet,"
              + " try again once the job starts running.");
    }
  }
}

Python

Looking for older samples? See the Storage Transfer Service Migration Guide.

from google.cloud import storage_transfer


def check_latest_transfer_operation(project_id: str, job_name: str):
    """Checks the latest transfer operation for a given transfer job."""

    client = storage_transfer.StorageTransferServiceClient()

    # The ID of the Google Cloud Platform Project that owns the job
    # project_id = 'my-project-id'

    # Storage Transfer Service job name
    # job_name = 'transferJobs/1234567890'

    transfer_job = client.get_transfer_job({
        'project_id': project_id,
        'job_name': job_name,
    })

    if transfer_job.latest_operation_name:
        response = client.transport.operations_client.get_operation(
            transfer_job.latest_operation_name)
        operation = storage_transfer.TransferOperation.deserialize(
            response.metadata.value)

        print(f"Latest transfer operation for `{job_name}`: {operation}")
    else:
        print(f"Transfer job {job_name} has not ran yet.")

View transfer job details

gcloud CLI

To view transfer job details, use gcloud transfer jobs describe:

gcloud transfer jobs describe JOB_NAME

To view this job's most recent operation, pass the value of latestOperationName to the operations describe command:

gcloud transfer operations describe OPERATION_NAME

To list all of a job's transfer operations, use the gcloud transfer operations list command:

gcloud transfer operations list --job-names=JOB_NAME

You can view operations for multiple jobs by listing them, comma-separated, as the value of --job-names. Omit --job-names to view operations for all jobs.

Google Cloud console

You can view the following job details from the Google Cloud console:

  • The job description and name
  • The source type and location
  • The destination location
  • Job frequency
  • Job statistics

To view transfer job details, do the following:

  1. In the Google Cloud console, go to the Storage Transfer Service page.

    Go to Storage Transfer Service

  2. Click the transfer job's description. The Job details page is displayed.

To display the details of a particular run, click the Start time for the job run. The following job information is available:

  • Transfer status
  • Start and stop times
  • Duration
  • Progress
  • Data transferred
  • Number of errors
  • Data skipped
  • Average speed estimate

Pause a transfer job

You can pause a transfer currently in progress. When you pause the transfer, the job state is maintained, and you can unpause it later. While a transfer is paused, the schedule will not trigger the job to run again.

gcloud CLI

To pause a transfer job, pass the job's current operation name to gcloud transfer operations pause.

gcloud transfer operations pause OPERATION_NAME

To resume a previously paused transfer job, which restarts the job in the same spot it was when it was paused, use gcloud transfer operations resume.

gcloud transfer operations resume OPERATION_NAME

Google Cloud console

To pause a transfer job, do the following:

  1. In the Google Cloud console, go to the Storage Transfer Service page.

    Go to Storage Transfer Service

  2. Click the transfer job's description. The Job details page is displayed.

  3. Click Pause run. The status for the current operation is displayed as Paused.

To resume a previously paused transfer job, restarting the job in the same spot it was when it was paused, follow these steps.

  1. In the Google Cloud console, go to the Storage Transfer Service page.

    Go to Storage Transfer Service

  2. Click the transfer job's description. The Job details page is displayed.

  3. Click Resume run.

    The status for the current operation is displayed as In progress.

Deactivate a transfer job

Deactivating a transfer job prevents the transfer job from starting any further scheduled operations, or operations manually started from the console. It does not prevent a job from being manually started with the API or with the jobs run gcloud command.

gcloud CLI

To deactivate a transfer job, update the job's status to disabled.

gcloud transfer jobs update JOB_NAME --status=disabled

To re-activate a job, set --status=enabled.

Google Cloud console

To deactivate a transfer job, do the following:

  1. In the Google Cloud console, go to the Storage Transfer Service page.

    Go to Storage Transfer Service

  2. Click the transfer job's description. The Job details page is displayed.

  3. Click Disable job. The Disable transfer job? dialog is displayed.

  4. Read the dialog, then confirm the job's deactivation by clicking Confirm.

    A notice at the top of the Job details page is displayed, reminding you that the job is deactivated.

Delete a transfer job

You can delete transfer jobs that you no longer need. Deleting a job does the following:

  • Stops any existing transfers that are part of the job.
  • Stops any recurring transfers that are part of the job.
  • Erases the job's configuration details.

Deleting a job is permanent. Once you delete the transfer job, it is removed from the list of transfer jobs. Transfer job information is fully deleted from Storage Transfer Service after 30 days.

Alternatively, you can deactivate the transfer job, which keeps the job listed in the Jobs page and lets you reactivate or modify the job.

gcloud CLI

To delete a transfer job, use gcloud transfer jobs delete.

gcloud transfer jobs delete JOB_NAME

Google Cloud console

To delete a transfer job, do the following:

  1. In the Google Cloud console, go to the Storage Transfer Service page.

    Go to Storage Transfer Service

  2. Select the checkbox next to the transfer job that you want to delete.

  3. Click Delete job.

    The Delete transfer job? dialog is displayed.

  4. Read the dialog, then confirm the job deletion by typing the job's automatically assigned name in the field and click Delete.

    The job is removed from the Jobs page.

REST

To cancel a single transfer operation, use the transferOperations cancel method. To delete an entire transfer job, including future transfer operations that are scheduled for it, set the transfer job's status to DELETED using the transferJobs patch method. Updating a job's transfer status doesn't affect transfer operations that are currently running. To cancel an in-progress transfer operation, use the transferOperations cancel method.

View error details

If you encounter errors during a transfer run, you can view error details to help troubleshoot the error.

To view error details for a transfer job run, do the following:

  1. In the Google Cloud console, go to the Storage Transfer Service page.

    Go to Storage Transfer Service

  2. Click the transfer job's description. The Job details page is displayed.

  3. Do one of the following to display job details:

    • Most recent job run: Click either the See error details button or the View error details link. The Error details page is displayed.

    • Historical job run:

      1. Click the job run's Start time.

        The Run details page is displayed.

      2. Click the View error details link.

        The Error details page is displayed.

  4. To display additional details about each displayed error, click Expand more.

  5. To filter errors, enter properties to filter in the Enter property name or value field.

    When you place your cursor in the field, a drop-down menu with relevant options is displayed to help you build your filter.