Ascp General Examples

Use the following Ascp examples to craft your own transfers.

To describe filepaths, use single-quote (' ') and forward-slashes (/) on all platforms. Avoid the following characters in filenames: / \ " : ' ? > < & * |

  • Fair-policy transfer

    Fair-policy transfer with maximum rate 100 Mbps and minimum at 1 Mbps, without encryption, transfer all files in \local-dir\files to

    # ascp --policy=fair -l 100m -m 1m /local-dir/files root@ 
  • Fixed-policy transfer

    Fixed-policy transfer with target rate 100 Mbps, without encryption, transfer all files in \local-dir\files to

    # ascp -l 100m /local-dir/files root@ 
  • Specify UDP port for transfer

    Transfer using UDP port 42000:

    # ascp -l 100m -O 42000 /local-dir/files user@ 
  • Public key authentication

    Transfer with public key authentication using the key file <home dir>/.ssh/aspera_user_1-key local-dir/files:

    $ ascp -l 10m -i ~/.ssh/aspera_user_1-key local-dir/files root@ 
  • Username or filepath contains a space

    Enclose the target in double-quotes when spaces are present in the username and remote path:

    # ascp -l 100m local-dir/files "User Name@ directory" 
  • Content is specified in a file pair list

    Specify source content to transfer to various destinations in a file pair list. Source content is specified using the full file or directory path. Destination directories are specified relative to the transfer user's docroot, which is specified as a "." at the end of the ascp command. For example, the following is a simple file pair list, filepairlist.txt that lists two source folders, folder1 and folder2, with two destinations, tmp1 and tmp2:

    # ascp --user=user_1 --host= --mode=send --file-pair-list=/tmp/filepairlist.txt .

    This command and file pair list create the following directories within the transfer user's docroot on the destination:

  • Network shared location transfer

    Send files to a network shares location \\\nw-share-dir, through the computer

    # ascp local-dir/files root@"//" 
  • Parallel transfer on a multi-core system

    Use parallel transfer on a dual-core system, together transferring at the rate 200Mbps, using UDP ports 33001 and 33002. Two commands are executed in different Terminal windows:

    # ascp -C 1:2 -O 33001 -l 100m /file root@ &
    # ascp -C 2:2 -O 33002 -l 100m /file root@ 
  • Upload with content protection

    Upload the file local-dir/file to the server with password protection (password: secRet):

    # export ASPERA_SCP_FILEPASS=secRet ascp -l 10m --file-crypt=encrypt local-dir/file root@

    The file is saved on the server as file.aspera-env, with the extension indicating that the file is encrypted. See the next example for how to download and decrypt an encrypted file from the server.

  • Download with content protection and decryption

    Download an encrypted file, file.aspera-env, from the server and decrypt while transferring:

    # export ASPERA_SCP_FILEPASS=secRet; ascp -l 10m --file-crypt=decrypt root@  /local-dir
  • Decrypt a downloaded, encrypted file

    If the password-protected file file1 is downloaded on the local computer without decrypting, decrypt file1.aspera-env (the name of the downloaded/encrypted version of file1) to file1:

    $ export ASPERA_SCP_FILEPASS=secRet; /opt/aspera/bin/asunprotect -o file1 file1.aspera-env 
  • Download through Aspera forward proxy with proxy authentication

    User Pat transfers the file /data/file1 to /Pat_data/ on, through the proxy server at with the proxy username aspera_proxy and password pa33w0rd. After running the command, Pat is prompted for the transfer user's (Pat's) password.

    # ascp --proxy dnats://aspera_proxy:pa33w0rd@ /data/file1 Pat@

Test transfers using faux://

For information on the syntax, see IBM Aspera High-Speed Transfer Server Admin Guide: Testing and Optimizing Transfer Performance.

  • Transfer random data (no source storage required)

    Transfer 20 GB of random data as user root to file newfile in the directory /remote-dir on

    #ascp --mode=send --user=root --host= faux:///newfile?20g /remote-dir
  • Transfer a file but do not save results to disk (no destination storage required)

    Transfer the file /tmp/sample as user root to, but do not save results to disk:

    #ascp --mode=send --user=root --host= /temp/sample faux://
  • Transfer random data and do not save result to disk (no source or destination storage required)

    Transfer 10 MB of random data from as user root and do not save result to disk:

    #ascp --mode=send --user=root --host= faux:///dummy?10m faux://