A4 Ascp Command Reference

The executable ascp (Aspera secure copy) is a command-line fasp transfer program. This topic covers the complete command usage, including general syntax guidelines, supported environment variables, a synopsis, and command options.

General Syntax Guidelines

Item Decription
symbols used in the paths Use single-quote (' ') and forward-slashes (/) on all platforms.
Characters to avoid / \ " : ' ? > < & * |

Environment Variables

If needed, you can set the following environment variables for use with the ascp command:

Item Initiation Command
Password ASPERA_SCP_PASS=password
Token ASPERA_SCP_TOKEN=token
Cookie ASPERA_SCP_COOKIE=cookie

Ascp Usage

ascp options [[user@]srcHost:]source_file1[,source_file2,...] [[user@]destHost:]target_path

Important: If you do not specify a username for the transfer, the local username will be authenticated (by default). In the case of a Windows machine and a domain user, the transfer server will strip the domain from the username (for example, authenticating Administrator, rather than DOMAIN\Administrator). Thus, you will need to specify a domain explicitly, if applicable to the user.

Ascp Options

Option Description
-h, --help Display usage.
-A, --version Display version and license information; then exit.
-T Disable encryption for maximum throughput.
-p Preserve file timestamps for source modification time (mtime) and last access time (atime).

Important: On Windows, mtime and atime may be affected when the system automatically adjusts for Daylight Savings Time (DST). For details, see the Microsoft KB article, http://support.microsoft.com/kb/129574.

-q Quiet mode (to disable progress display).
-l max_rate Set the target transfer rate in Kbps (default: 10000 Kbps). If the ascp client does not specify a target rate, it will be acquired from aspera.conf (server-side, as the local aspera.conf target rate setting doesn't apply). If local or server aspera.conf rate caps are specified, the "starting" (default) rates will be not higher than the cap.
-m min_rate Set the minimum transfer rate in Kbps (default: 0. If the ascp client does not specify a minimum rate, it will be acquired from aspera.conf (server-side, as the local aspera.conf minimum rate setting doesn't apply). If local or server aspera.conf rate caps are specified, the "starting" (default) rates will be not higher than the cap.
-i private_key_file Use public key authentication and specify the private key file. Typically, the private key file is in the directory $HOME/.ssh/id_[algorithm].
-Z dgram_size Specify the datagram size (MTU) for FASP. By default, the detected path MTU is used. (Range: 296 - 10000 bytes)

Note: As of version 3.3, datagram size can also be enforced by the server using <datagram_size> in aspera.conf. If size is set with both -Z (client side) and <datagram_size> (server side), the <datagram_size> setting is used. If the client-side is pre-3.3, datagram size is determined by the -Z setting, regardless of the server-side setting for <datagram_size>. In this case, if there is no -Z setting, datagram size is based on the discovered MTU and the server logs the message "LOG Peer client doesn't support alternative datagram size".

-L local_log_dir Specify a logging directory in the local host, instead of using the default directory.
-R remote_log_dir Specify a logging directory in the remote host, instead of using the default directory.
-O fasp_port Set the UDP port to be used by fasp for data transfer. (Default: 33001)
-P ssh-port Set the TCP port to be used for fasp session initiation. (Default: 33001)
-X rexmsg_size Adjust the maximum size in bytes of a retransmission request. (Max: 1440).
--mode=mode Specify the transfer direction, where mode is either send or recv.
--user=username The user name to be authenticated by the transfer server.

Important: If you do not specify a user name for the transfer, the local username will be authenticated (by default). In the case of a Windows machine and a domain user, the transfer server will strip the domain from the username (e.g. authenticating "Administrator," rather than "DOMAIN\Administrator"). Thus, you will need to explicitly specify a domain, if applicable to the user.

--host=host The server's hostname or address. This option can be used instead of prefixing the destination with host: as, for example, 10.0.0.2:/space.
--policy=transfer_policy Set the transfer policy, which can be any of the following:
  • fixed – Attempts to transfer at the specified target rate, regardless of the actual network capacity. This policy transfers at a constant rate and finishes in a guaranteed time. This policy typically occupies most of the network's bandwidth, and is not recommended in most file transfer scenarios. In fixed mode, a maximum (target) rate value is required.
  • high – Monitors the network and adjusts the transfer rate to fully utilize the available bandwidth up to the maximum rate. When congestion occurs, a it transfers at a rate twice of a session with fair policy. In this mode, both the maximum (target) and the minimum transfer rates are required.
  • fair – Monitors the network and adjusts the transfer rate to fully utilize the available bandwidth up to the maximum rate. When other types of traffic build up and congestion occurs, it shares bandwidth fairly by transferring at an even rate. In this mode, both the maximum (target) and the minimum transfer rates are required.
  • low – Similar to fair mode, the low policy uses the available bandwidth up to the maximum rate, but is much less aggressive when sharing bandwidth with other network traffic. When congestion builds up, the transfer rate is reduced to the minimum rate until other traffic retreats.

Important: If --policy is set on the command line, it will be reflected in the GUI. If no related options are specified on the command line, ascp uses the server-side policy setting (fair by default).

--file-list=filename Take the list of sources to transfer from filename. The file list supports UTF-8 files and input from standard input through "-". The sources can exist on either the local host or the remote host (in terms of download), but not on both. Each source must be specified on a separate line:
  • src
  • src2
  • ...
  • srcN

Important: Multiple --file-list options are not supported in a single ascp command. If multiple file lists are specified, all but the last will be ignored. In addition, you cannot also include file names on the command line when you use --file-list. Only files from the file list will be transferred.

--overwrite=method Overwrite files with the same name. This option takes following values (Default: diff):
  • always – Always overwrite the file.
  • never – Never overwrite the file. However, note that if the parent folder is not empty, its access, modify, and change times may still be updated.
  • diff – Overwrite if file is different from the source (i.e., if a complete file exists at the destination (no .aspx file) and is the same as the source file, then leave it unmodified (no change on timestamp/attributes either); otherwise re-transfer the whole source file). Note this policy interacts with the resume policy.
--sparse-file Writing sparse files to disk. This mode indicates the file is sparsed and a4 has to avoid writing zero contents of the file to disk. In this mode, a4 writes a block to disk if even one bit is set in that block, otherwise a4 avoids writing the block (by default a4 blocks are 64K).
--src-base=prefix Specify the prefix to be stripped off from each source object. The remaining portion of the source path is kept intact at the destination. This feature is available in send mode only (--mode=send).

For example, the "clips" directory on the remote computer contains the following folders and files:

/clips/outgoing/file1
/clips/outgoing/folderA/file2
/clips/outgoing/folderB/file3 

In this case, to transfer all folders and files within the "outgoing" folder (but not the "outgoing" folder, itself), run the following command:

$ ascp -d --src-base=/clips/outgoing/ root@10.0.0.1:/clips/outgoing/ /incoming  

Result: The following folders and files appear in the "incoming" directory at the destination:

(docroot)/incoming/file1
(docroot)/incoming/folderA/file2
(docroot)/incoming/folderB/file3 

Files outside of the source base (for example, /temp/file4) are not transferred, and warnings are generated.

Without --src-base

If --src-base is not used, and the source item is a folder, the contents of the folder are transferred, along with the folder itself. For example:

$  ascp -d root@10.0.0.1:/clips/outgoing/ /incoming  

Result:

(docroot)/incoming/outgoing/file1
(docroot)/incoming/outgoing/folderA/file2
(docroot)/incoming/outgoing/folderB/file3
If --src-base is not used, and the source item is a file, only the file is transferred, not the folders in the file's path. For example:
$  ascp -d root@10.0.0.1:/clips/outgoing/file1 root@10.0.0.1:/clips/outgoing/folderA/file2 /incoming

Result:

(docroot)/incoming/file1
(docroot)/incoming/file2
--preserve-file-owner-uid (OS X and Linux/UNIX systems only.) Preserve transferred files' owner information (uid).

Note: This option requires the transfer user be authenticated as a superuser.

--preserve-file-owner-gid (OS X and Linux/UNIX systems only.) Preserve transferred files' group information (gid).

Note: This option requires the transfer user be authenticated as a superuser.

--preserve-access-time Currently has the same effect as -p.
--preserve-source-access-time Currently has the same effect as -p.
--preserve-modification-time Currently has the same effect as -p.
--preserve-creation-time Currently has the same effect as -p. This feature is supported on Windows only.
--chunk-size=bytes Buffer size used for storage read/write operations as well as an internal transmission and compression "unit".
--read-threads=num Number of storage "read" threads. Default: 2.
--write-threads=num Number of storage "write" threads. Default: 2.
--compression=method The method argument can be one of: none or qlz . Default is qlz . Compress file data inline.
--compression-hint=num For compression algorithms that offer configuration of compression levels. Currently this is only used by zlib. A lower number compresses the data less but executes more quickly (0 = no compression). A higher number offers higher compression at the cost of higher compression time. Acceptable values are -1 to 9, where -1 is a "balanced" selection of the tradeoff between compression and performance. Default: -1.
--memory=bytes Maximum memory that the ascp process is allowed to use. Default: 256MB.
--remote-memory=bytes Maximum memory that the remote ascp process is allowed to use. Default: 256MB.