-
Growing files
The growing files feature allows you to start transferring files to the target directory while they are still being written to the source directory.
Download the growing file
myfile with a wait period of 120 seconds that uses a 0 bytes read that calculates the wait time.
ascp --mode=recv --user=root --host=10.0.0.2 "file:////tmp/myfile?grow=120&wait_start=null_read" file:////tmp2/mylocalfile
To support this command, the
ascp.conf file must include the following configuration:
<default>
<file_system>
<access>
<paths><path><absolute>
file:////tmp?grow=120;wait_start=null_read
</absolute></path></paths>
</access>
</file_system>
</default>
For more information, see aspera.conf - File system configuration.
- Basic WebSocket upload
Upload a file using the WebSocket protocol. The Aspera® Node Service provides a WebSocket server, which must be enabled (see aspera.conf - WebSocket configuration). The Aspera Node Service always uses TLS for WebSocket connections (WSS), regardless of proxy configuration. The enable_http and enable_https settings control whether the REST Node API is available using HTTP and/or HTTPS through the configured ports (9091 and 9092 by default) and are not related to WebSocket connections. Because the ascp client supports only secure WebSocket transfers, a reverse proxy must be used to terminate the HTTPS connection to the WebSocket server.
A basic token, bearer token, or transfer token must be used with a WebSocket connection. Note that basic tokens work only for access key credentials but do not work for regular node API credentials. For more information, see Introduction to Aspera authentication and authorization.
The following ascp options are required for the use of a WebSocket:
--ws-connect: Specifies the use of WebSocket,
-P 9093: Specifies the WebSocket port.
> ascp --ws-connect -P 9093 --host=www.example.com --mode=send --user=xeno c:/Users/xeno/Desktop/myfile /Desktop/dest
- WebSocket download with target rate
Download a file from a remote server using WebSocket with a target rate of 100 Mbps:
> ascp --ws-connect -P 9093 -l 100m --host=transfer.example.com --mode=recv --user=xeno /remote-dir/largefile.zip c:/Downloads/
- WebSocket transfer with custom certificate
Use a custom CA certificate for WebSocket transfer instead of the system default:
> ascp --ws-connect -P 9093 -i c:/certs/ca-cert.pem --host=secure.example.com --mode=send --user=xeno c:/data/files /remote-backup/
- WebSocket transfer with fair policy and rate limits
Transfer using WebSocket with fair policy, maximum rate 200 Mbps and minimum rate 10 Mbps:
> ascp --ws-connect -P 9093 --policy=fair -l 200m -m 10m --host=node.example.com --mode=send --user=xeno c:/project/data /archive/project/
- WebSocket transfer with resume support
Transfer large files using WebSocket with resume capability in case of interruption:
> ascp --ws-connect -P 9093 -k 1 --host=transfer.example.com --mode=send --user=xeno c:/media/video.mp4 /uploads/
- 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 10.0.0.2:
> ascp --policy=fair -l 100m -m 1m /local-dir/files root@10.0.0.2:/remote-dir
- Fixed-policy transfer
Fixed-policy transfer with target rate 100 Mbps, without encryption, transfer all files in \local-dir\files to 10.0.0.2:
> ascp -l 100m /local-dir/files root@10.0.0.2:/remote-dir
- Specify UDP port for transfer
Transfer by using UDP port 42000:
> ascp -l 100m -O 42000 /local-dir/files user@10.0.0.2:/remote-dir
- Public key authentication
Transfer with public key authentication by using the key file /Documents and Settings/aspera_user_1/.ssh/aspera_user_1:
> ascp -l 10m -i "/Documents and Settings/aspera_user_1/.ssh/aspera_user_1" local-dir/files root@10.0.0.2:/remote-dir
- Username or file path contains a space
Enclose the target in double quotation marks (" ") when spaces are present in the username and remote path:
> ascp -l 100m local-dir/files "User Name@10.0.0.2:/remote 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 by 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:
/tmp/folder1
tmp1
/tmp/folder2
tmp2
> ascp --user=user_1 --host=10.0.0.2 --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:
/tmp1/folder1
/tmp2/folder2
- Network shared location transfer
Send files to a network shares location \\1.2.3.4\nw-share-dir, through the computer 10.0.0.2:
> ascp local-dir/files root@10.0.0.2:"//1.2.3.4/nw-share-dir/"
- Parallel transfer on a multi-core system
Use parallel transfer on a dual-core system, together transferring at the rate 200 Mbps, by using UDP ports 33001 and 33002. Two commands are run in different Terminal windows:
> ascp -C 1:2 -O 33001 -l 100m /file root@10.0.0.2:/remote-dir &
> ascp -C 2:2 -O 33002 -l 100m /file root@10.0.0.2:/remote-dir
- Upload with content protection
Upload the file local-dir/file to the server 10.0.0.2 with password protection (password: secRet):
> set ASPERA_SCP_FILEPASS=secRet&& ascp -l 10m --file-crypt=encrypt local-dir/file root@10.0.0.2:/remote-dir/
The file is saved on the server as file.aspera-env, with the extension that indicates 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 10.0.0.2 and decrypt during the transfer:
> set ASPERA_SCP_FILEPASS=secRet&& ascp -l 10m --file-crypt=decrypt root@10.0.0.2:/remote-dir/file.aspera-env /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 and encrypted version of file1) to file1:
> set ASPERA_SCP_FILEPASS=secRet&& 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 10.0.0.2, through the proxy server at 10.0.0.7 with the proxy username aspera_proxy and password pa33w0rd. After the command is run, Pat is prompted for the transfer user's (Pat's) password.
> ascp --proxy dnats://aspera_proxy:pa33w0rd@10.0.0.7 /data/file1 Pat@10.0.0.2:/Pat_data/