Trap links are small text files that reference a single target object in your
AWS S3 storage. With a Trap link, you can save an object in a
different location and with a different name without actually duplicating the
object. For use cases, see the examples following the configuration
instructions.
Limitations:
- The target and link file must be accessible with the same storage
credentials.
- When uploading a link file, Aspera does not check if an object with the trap
link file name exists at the destination. For example, if you create the object
test and upload a link file
.test.asp-trapd-lnk to the same folder, the Aspera
client file browser (such as an Enterprise Server GUI) shows two objects with
the name test. Any file operations on
test are performed on the real object, not the link
file.
Configure your Aspera server and create Trap links:
-
Log in to your Aspera server as root.
# ssh -i identity_file -p 33001 ec2-user@ec2_host_ip
# sudo su -
-
Enable symlink support in s3.properties or the
docroot.
In s3.properties:Open
/opt/aspera/etc/trapd/s3.properties. Locate the following
line:
#aspera.session.support.symlink = false
Uncomment
the line and change the value to
true:
aspera.session.support.symlink = true
Save your changes.
In the docroot: Set symlink support in the
docroot as a query, for
example:
s3://user1:password@s3.amazonaws.com/path?aspera.session.support.symlink=true
-
Restart Trapd to activate your changes.
# /etc/init.d/asperatrapd restart
-
Create a trap link file.
On a computer from which you can upload to your object storage, create a text
file with a name that follows the format:
.name.asp-trapd-lnk
The
file name must start with a dot (.) and end with the
asp-trapd-lnk suffix. The name
is the object name that is returned when browsing the object storage with an
Aspera client; browsing an object store with the storage's default browser,
such as AWS Console for S3, shows the link file as is.
The content of
the object is the complete path to the target object, including the bucket
or container name. The path should not be URL encoded.
-
Upload the trap link file to the desired location in object storage.
Example 1: Providing a descriptive filename
You have an object in AWS S3 with the following
path:
/mybucket/production/content/29837987350097234987.mpeg
To
rename it for your Aspera clients as World-Cup Best-of-day
1.mpeg, create a link file with the following properties:
- name: .World-Cup Best-of-day 1.mpeg.asp-trapd.lnk
- content:
/mybucket/production/content/29837987350097234987.mpeg
Upload the link file to the shared bucket. Now when Aspera clients browse the
bucket, they see the World-Cup Best-of-day 1.mpeg
object.
Example 2: Accessing content between bucketsYou have uploaded a
200 MB file with the following
path:
/mybucket/music/album2/200MB
On the
client you create a link file with the following properties:
- name: .Awesome.mp4.asp-trapd-lnk
- content: /mybucket/music/album2/200MB
Upload the link file to the desired location, for example
/mybucket/transfer. Now when browsing
/mybucket/transfer through the Aspera client, you see a
file called Awesome.mp4 that is 200 MB. When you download it,
it has the same content as the /mybucket/music/album2/200MB
file.
Example 3: Creating a Faspex package with existing files in cloud
storageUsing the link file from example 1, .World-Cup Best-of-day
1.mpeg.asp-trapd.lnk, you upload the link file to the Faspex internal
storage location. The target file is not copied nor renamed, but when the package is
downloaded, the file is received as World-Cup Best-of-day
1.mpeg.