[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-08-18。"],[],[],null,["# Transfer agent command-line options\n\nTransfer agents transfer data from your file system to Google Cloud. You\ncan control agent options when you run an\nagent through the flags and options described in this page.\n\nCommand summary\n---------------\n\n```\nsudo docker run [--ulimit memlock=64000000 -d --rm -v host-directory:container-directory]\n--env environment-variable=variable-value\ngcr.io/cloud-ingest/tsop-agent:latest\n{--help | --version | --project-id=project-id}\n[--agent-id-prefix=id-prefix --creds-file=credential-file\n--enable_mount_directory --hostname=hostname\n--log-dir=logs-directory\n--max-physical-mem=maximum-memory]\n```\n\nDocker options\n--------------\n\n`--ulimit memlock=64000000`\n: Locks shared memory for a shared pool for Docker, so that it is always in\n memory for access by multiple sessions.\n\n`-d`\n\n: Starts the Docker container in detached mode, or in the background. This\n allows you to continue issuing commands from the Linux terminal.\n\n For more information, see\n [Detached -d](https://docs.docker.com/engine/reference/run/#detached--d)\n\n`--rm`\n\n: Deletes the container and the container's file system when Docker exits.\n\n For more information, see\n [Clean up (--rm)](https://docs.docker.com/engine/reference/run/#clean-up---rm)\n\n`-v `\u003cvar translate=\"no\"\u003ehost-directory\u003c/var\u003e`:`\u003cvar translate=\"no\"\u003econtainer-directory\u003c/var\u003e\n\n: Specifies one or more\n [volumes](https://docs.docker.com/storage/volumes/) to\n map from the host to the container. When using `-v`, we require\n the \u003cvar translate=\"no\"\u003ehost-directory\u003c/var\u003e\n and \u003cvar translate=\"no\"\u003econtainer-directory\u003c/var\u003e to be the same, otherwise\n Storage Transfer Service won't successfully locate your files for transfer.\n\n For more information, see\n [VOLUME (shared file systems)](https://docs.docker.com/engine/reference/run/#volume-shared-filesystems)\n\n`--env `\u003cvar translate=\"no\"\u003eenvironment-variable\u003c/var\u003e`=`\u003cvar translate=\"no\"\u003evariable-value\u003c/var\u003e\n\n: Specifies an environment variable for the Docker container. Use this flag to\n configure your agents to use a forward proxy. For more information, see\n [Using a forward proxy](/storage-transfer/docs/on-prem-agent-details#using-forward-proxy).\n\nAgent options\n-------------\n\n`--agent-id-prefix=`\u003cvar translate=\"no\"\u003eid-prefix\u003c/var\u003e\n: An optional prefix that is prepended to the agent ID to help identify the\n agent or its machine in the Google Cloud console. When a prefix is used, the\n agent ID is formatted as `prefix + hostname + Docker container ID`.\n\n`--creds-file=`\u003cvar translate=\"no\"\u003ecredential-file\u003c/var\u003e\n\n: An optional JSON-formatted service account credential file. For more\n information about generating a service account credential file, see\n [creating and managing service account keys](https://cloud.google.com/iam/docs/creating-managing-service-account-keys).\n\n | **Note:** Unless you are using `--enable_mount_directory`, you must prefix this path with `/transfer_root`, for example `/transfer_root/path/to/cred_file.json`.\n\n`--enable_mount_directory`\n\n: Optionally mounts the whole file system under the directory\n `/transfer_root` within the Docker container, rather than\n specifying individual\n [Docker `-v`volume mounts](https://docs.docker.com/storage/volumes/).\n When using this flag, you don't need to prefix `/transfer_root`\n to the log directory or the service account credentials file path, and\n `/transfer_root` isn't visible in transfer logs or GUI error\n samples.\n\n`--help`\n\n: Displays brief usage help.\n\n`--hostname=`\u003cvar translate=\"no\"\u003ehostname\u003c/var\u003e\n\n: set the hostname that the agent is running on. Used to report the hostname\n of the machine a particular agent is running on.\n\n | **Note:** We recommend passing `--hostname=$(hostname)` when using this flag.\n\n`--log-dir=`\u003cvar translate=\"no\"\u003elogs-directory\u003c/var\u003e\n\n: An optional directory that the agent writes logs to. The default directory\n is `/tmp/`.\n\n | **Note:** Unless you are using `--enable_mount_directory`, you must prefix this path with `/transfer_root`, for example, `/transfer/root/path/to/log_file`.\n\n`--max-physical-mem=`\u003cvar translate=\"no\"\u003emaximum-memory\u003c/var\u003e\n\n: Agents default to using 8GiB maximum of system memory. If the default\n doesn't fit your environment, you can specify a relevant maximum memory\n usage in the following formats:\n\n`--project-id=`\u003cvar translate=\"no\"\u003eproject-id\u003c/var\u003e\n\n: Required string of the project ID that is hosting the transfer resources that are created and billed.\n\n`--version`\n\n: Displays the current version of the agent."]]