Secure Rsync usage examples

Here are examples to securely view directory lists, uploading, and downloading files.

Secure Rsync usage examples

Each NetStorage access method has an optimized upload domain. Use <Domain name prefix>.rsync.upload.akamai.com for rsync uploads.

Upload a single file with Secure Rsync

In this example, a single file is to be uploaded. Here, the <src> variable is included first, to target the file for upload, and the <dest> variable exists as the path in the target storage group.
Format
rsync <option> -e "ssh -i <private key>" <src> sshacs@<Upload Domain Name>:/<CPCode>/<dest>/
Usage
rsync -av -e "ssh -i usr/local/scripts/keys/private_1.ppk" /uploads/footage_03-13.mp4 sshacs@baseball.rsync.upload.akamai.com:/123456/baseball/
Note: Ensure that the path included for the destination ends in a trailing slash (“/”). Otherwise the operation will rename the file. In the example above, if the trailing slash was left out, “footage_ 03-13.mp4” would be renamed to “baseball.”

Download a single file with Secure Rsync

In this example, a single file is targeted for download. Here, the <src> variable represents the path to the target file in the storage group, and the <dest> is included last to specify where on the local system the file is to be downloaded.
Format
rsync <option> -e "ssh -i <private key>" sshacs@<Upload Domain Name>:/<CPCode>/<src> <dest>
Usage
rsync -av -e "ssh -i usr/local/scripts/keys/private_1.ppk" sshacs@baseball.rsync.upload.akamai.com:/123456/baseball/footage_03-13.mp4 /downloads/baseball/

View a directory contents with Secure Rsync

In this example, a single directory is called out to view its contents. Here, a <src> variable is not included because a specific file isn't being moved. The <dest> variable serves to call out the specific directory to be viewed.
Format
rsync <option> -e "ssh -i /<private key>" sshacs@<Upload Domain Name>:/<CPCode>/<dest>
Usage
rsync -av -e "ssh -i usr/local/scripts/keys/ssh/private.ppk" sshacs@baseball.rsync.upload.akamai.com:/123456/baseball/
Note: If you have applied a “passphrase” with your SSH key, it will be requested when issuing a secure command. Various methods can be incorporated to bypass this requirement, but they are not recommended. For added security, we recommend that you use the standard approach and input the passphrase when requested.