Note: Please go to docs.rightscale.com to access the current RightScale documentation set. Also, feel free to Chat with us!
Home > Guides > Dashboard Users Guide > Design > RightScripts > Concepts > About RightScript Attachments

About RightScript Attachments

Table of Contents

What is an attachment?

An attachment is a file that you can statically link with a RightScript.  It's useful for attaching smaller files for development and testing purposes where  can easily use the attached files in your RightScript's code using the 'RS_ATTACH_DIR' environment variable.  For example, you could attach a MySQL dumpfile (.gz) or tarball of your application code (.tgz) to an install boot script. However, for production environments, it is recommended that you store your application code in a git/svn repository and your database backups using automated backups that are created using RightScale-published ServerTemplates.

How do I upload an attachment to a RightScript?

See Upload an Attachment to a RightScript.

Where are attachments stored?

When you upload an attachment to a RightScript in your own RightScale account, RightScale will store the object in our local repository and will make the object available to the instance at runtime.

Can I edit an attachment in the Dashboard?

Yes. See Edit RightScript Attachments.

What is the maximum size of an attachment?

100 MB

How do I call an attachment in a RightScript?

Before a RightScript is run on an instance, all of its attachments are downloaded to a temporary directory. The path to the temporary directory is passed to the script in the RS_ATTACH_DIR environment variable.  All files will be stored in that directory using their original file names (without any path component).  

Note: Please use RS_ATTACH_DIR, as the ATTACH_DIR variable has been deprecated.

Bash:  $RS_ATTACH_DIR

Ruby:  ENV['RS_ATTACH_DIR']

Powershell:  "$env:RS_ATTACH_DIR"

You must to post a comment.
Last modified
22:35, 16 May 2013

Tags

This page has no custom tags.

Classifications

This page has no classifications.

Announcements

None


© 2006-2014 RightScale, Inc. All rights reserved.
RightScale is a registered trademark of RightScale, Inc. All other products and services may be trademarks or servicemarks of their respective owners.