You need to enable JavaScript to run this app.
Torch Object Storage

Torch Object Storage

Copy page
Download PDF
Auxiliary commands
Copy local files (fcp)
Copy page
Download PDF
Copy local files (fcp)
You can use the fcp command to copy local files or folders from the source to the destination.​
Command syntax​
  • Copy a file​
​
Linux/macOS
Windows
​
​
​
./tosutil fcp file_url1 file_url2|folder_url2 [-dryRun] [-link] [-tempFileDir=xxx] [-useTempFile] [-u] [-vchecksum] [-dfo] [-fsync] [-rbs=1MB] [-wbs=1MB] [-rdio] [-rmmap] [-wdio] [-wmmap] [-ea=xxx] [-sdk=xxx] [-dek=xxx] [-fr] [-o=xxx] [-nftr]​
​
​
​
  • Copy a folder​
​
Linux/macOS
Windows
​
​
​
./tosutil fcp fold_url1 fold_url2 -r [-dryRun] [-link] [-tempFileDir=xxx] [-useTempFile] [-u] [-vchecksum] [-dfo] [-fsync] [-rbs=1MB] [-wbs=1MB] [-rdio] [-rmmap] [-wdio] [-wmmap] [-ea=xxx] [-sdk=xxx] [-dek=xxx] [-flat] [-j=1] [-nfj=1] [-include=*.xxx] [-exclude=*.xxx] [-timeRange=time1-time2] [-at] [-dmf] [-o=xxx] [-nftr]​
​
​
​
  • Resume a failed task​
​
Linux/macOS
Windows
​
​
​
./tosutil fcp -recover=xxx [-dryRun] [-link] [-tempFileDir=xxx] [-useTempFile] [-u] [-vchecksum] [-dtf] [-dfo] [-fsync] [-rbs=1MB] [-wbs=1MB] [-rdio] [-rmmap] [-wdio] [-wmmap] [-ea=xxx] [-sdk=xxx] [-dek=xxx] [-j=1] [-nfj=1] [-include=*.xxx] [-exclude=*.xxx] [-timeRange=time1-time2] [-at] [-dmf] [-o=xxx] [-nftr]​
​
​
​
  • Test read/write performance using a local file​
​
Linux/macOS
Windows
​
​
​
./tosutil fcp file_url -dt=xxx [-ds=10MB] [-link] [-tempFileDir=xxx] [-useTempFile] [-dfo] [-fsync] [-rbs=1MB] [-wbs=1MB] [-rdio] [-wdio] [-wmmap] [-nftr]​
​
​
​
​
Parameters​
​
Parameter​
Type​
Description​
file_url1​
folder_url1​
String​
The source path for copying the local file/folder. When specifying a source folder, use it with the -r parameter.​
file_url2​
folder_url2​
String​
The destination path for copying the local file/folder.​
-r​
Bool​
Copy the folder recursively.​
-dryRun​
Bool​
Run in test mode without executing any actual operations.​
-link​
Bool​
Copy the actual target path pointed to by symbolic links for both files and folders, rather than copying the symbolic link files themselves.​
-tempFileDir​
String​
The folder used to store temporary files during copy operations. It is created under the same parent folder as the files being copied.​
-useTempFile​
Bool​
Create a copy by first writing a temporary file and then renaming it to the final file.​
-recover​
String​
The ID of the copy task to be resumed in the result file.​
-u​
Bool​
This parameter is used for incremental copies of files. It compares the source and destination. We recommend using this setting in the following cases:​
  • The destination does not exist.​
  • The file size at the destination differs from that at the source.​
  • The last modified time at the destination is earlier than that at the source.​
-vchecksum​
Bool​
Validate data integrity during copy operations using the CRC-64 algorithm.​
-dfo​
Bool​
When copying on Linux or macOS, do not force overwriting the local executable if it is running.​
-fsync​
Bool​
Use fsync to flush data to the disk during the copy process.​
-rbs​
String​
The read buffer size for the source, in bytes. This value is set to the readBufferIoSize value in the configuration file by default.​
-wbs​
String​
The write buffer size for the destination, in bytes. This value is set to the writeBufferIoSize value in the configuration file by default.​
-rdio​
Bool​
Use direct io when reading from the source on Linux/MacOS.​
-rmmp​
Bool​
Use memory mapping (mmap) when reading from the source on Linux/MacOs.​
-wdio​
Bool​
Use direct io when writing to the destination on Linux/macOS.​
-wmmp​
Bool​
Use memory mapping (mmap) when writing to the destination on Linux/MacOS. Setting this parameter will override the useTempFile parameter.​
-ea​
String​
The algorithm used to encrypt and decrypt local files during copying. Possible values:​
  • aes256​
tip​
The AES-256-CTR encryption is used by default.​
-eam​
String​
The algorithm mode used to encrypt and decrypt local files during copying. Possible values:​
  • CTR​
  • CBC​
The default is CTR.​
-sdk​
String​
The decryption key used for the source during copying. When the decryption algorithm is AES-256, the key must be 32 characters in length.​
-dek​
String​
The encryption key used for the destination during copying. When the encryption algorithm is AES-256, the key must be 32 characters in length.​
-flat​
Bool​
Do not include the relative parent directory when copying files.​
-j​
Integer​
The maximum concurrency for batch operations. This value is set to 3 by default, which is the defaultJobs value in the configuration file.​
-nfj​
Integer​
The maximum concurrency for batch processing small files (less than 1 MB).​
-include​
String​
The file matching pattern used to include files during copy operations. You can use the wildcards ? and * and the delimiter "#" in the match expression.​
-exclude​
String​
The file matching pattern used to exclude files from copy operations. You can use the wildcards ? and * and the delimiter "#" in the match expression.​
-timeRange​
String​
Sets the time range for the last modified time of files during copy operations, in the format of YYYYMMDDHHmmSS-YYYYMMDDHHmmSS.​
-at​
Bool​
Copy a list of files whose last access time falls within the "-timeRange".​
-ddo​
Bool​
Do not upload the folder itself as an object.​
-dmf​
Bool​
Do not apply the parameters, "-include/-exclude" and "-timeRange", to folders.​
-dt​
String​
Test read or write performance. Possible values:​
  • source​
  • destination​
-ds​
String​
The file size for single-stream read or write performance testing, in bytes. The default value is 10 MB.​
-fr​
Bool​
Generate a result file when working with a single file.​
-o​
String​
The folder where result files are stored. The default location is specified in the configuration file as defaultOutputDir.​
-nftr​
Bool​
Do not use the Truncate parameter to specify file size when creating a new file.​
​
Examples​
Copy a file​
Use the following command to copy the object file from the /Users/Downloads/TOS/tosutil folder as /Users/Downloads/TOS/tosutil/object1.​
  • Command​
  • ​
    ./tosutil fcp /Users/Downloads/TOS/tosutil/object /Users/Downloads/TOS/tosutil/object1​
    ​
  • Output​
  • ​
    Start at 2023-11-27 04:46:38.577567 +0000 UTC​
    ​
    ​
    Jobs: 5 VerifyChecksum: false​
    TempFileDir: auto​
    ​
    [---------------------------------------------] 100.00% ?/s 15.09MB/15.09MB 7ms​
    ​
    Copy local file/folder successfully, 15.09MB, n/a, /Users/Downloads/TOS/tosutil/object --> /Users/Downloads/TOS/tosutil/object1, cost [7]​
    ​
Copy a folder​
Use the following command to copy all files in the /Users/Downloads/TOS/tosutil/folder1 folder to /Users/Downloads/TOS/tosutil/folder2.​
tip​
This command copies the folder while preserving the directory structure. All copied files reside within the folder2 folder.​
  • Command​
  • ​
    ./tosutil fcp /Users/Downloads/TOS/tosutil/folder1 /Users/Downloads/TOS/tosutil/folder2 -r​
    ​
  • Output​
  • ​
    Start at 2023-11-27 05:02:14.869508 +0000 UTC​
    ​
    ​
    Jobs: 5 VerifyChecksum: false​
    OutputDir: /Users/bytedance/.tosutil_output​
    TempFileDir: auto​
    ​
    [-------------------------------] 100.00% tps:0.00 ?/s 4/4 30.18MB/30.18MB 11ms​
    Succeed count is: 4 Failed count is: 0​
    Succeed bytes is: 30.18MB​
    Metrics [max cost:11 ms, min cost:0 ms, average cost:5.25 ms, average tps:333.33]​
    ​
    Task id is: 2190c0c4-8ce2-11ee-8d1f-b645e1163e54​
    ​
Test file read/write performance​
Use the following command to test the performance of reading the object.mov file in the /Users/Downloads/TOS/tosutil/folder1 folder.​
  • Command​
  • ​
    ./tosutil fcp /Users/bytedance/Downloads/TOS/tosutil/180/folder1/object.mov -dt=source​
    ​
  • Output​
  • ​
    Start at 2023-12-18 09:42:11.792216 +0000 UTC​
    ​
    ​
    Jobs: 5 VerifyChecksum: false​
    TempFileDir: auto​
    ​
    [---------------------------------------------] 100.00% ?/s 10.00MB/10.00MB 4ms​
    ​
    Detect copy local file/folder successfully, 10.00MB, n/a, /Users/bytedance/Downloads/TOS/tosutil/folder1/object.mov --> [dustbin], cost [4]​
    ​
tip​
For more command examples, see Uploading objects.​
​
Last updated: 2025.12.17 18:33:43