A collection of tools for working with files and filesystems.

Note: There is an oddity in the version numbering: version was followed immediately by version (skipping; version was then released following version (and is identical to version aside from the version number); normal numbering then resumed with version, .5, .6 etc. following version (skipping version, as that number was already used).



Crystallize provides the following primary user-facing command-line scripts.

Archives a snapshot of a file or files and removes it/them (unless --keep is specified), providing an address and/or a pointer file that can be used to retrieve it/them. Synopsis: crystallize [--keep] [--] [--leave-pointer] <file>...
Backs up crystallized files with their associated metadata to the current directory. Synopsis: crystallize-backup <crystal-address>
Retrieves files stored using crystallize to the current directory, given their address. Synopsis: decrystallize <crystal-address> [--here]
Retrieves files stored using crystallize to the current directory, given a path to a pointer directory. Does not handle single-file pointers: use sreg_read_stream instead. Synopsis: decrystallize-pointer <file> [--here]

The following public-facing scripts are either used internally by the other tools and are mainly useful for writing other shell scripts, or are not thoroughly tested.

Retrieve a configuration value from the configuration file used by Crystallize tools. Synopsis: crystallize-getconf <configuration-key-name>
Retrieve a file stored using quickliquid. Synopsis: dequicklify (--no-trim-extensions|--trim-extensions) <URL>
Create an "fcache" cache directory: fcache is a naïve caching layer for non-changing URLs. Synopsis: fcache_init <directory-name> <cache-size-limit-in-bytes> (if the cache directory already exists, the current size limit will override the one provided as an argument)
Get an item using the specified "fcache" cache. Synopsis: fcache_request <cache-directory> <URL>
Quickly upload a file to the Internet Archive. Synopsis: quickliquid <file>
Not ready for production use! Provides tools for managing filesystems. Synopsis: rubberfs ( ((create|mount|soft-mount|remount|rename|cd|unmount|soft-unmount|attach|check|save|freeze|delta|gc|thaw|patch|status|list|usage-write|destroy|destroy-no-upload|historybak|historypull) [RubberFS name]) | usage | whereami | stub | (stash <file>...) )
Not ready for production use! Streaming upload to Amazon S3–compatible endpoints, supporting some of the Internet Archive's extensions to S3. Synopsis: s3-streaming-upload <host-name> <collection> <identifier> <remote-file-name> <file-size-estimate> <title> <description> <keywords> [access-key-id] [secret-access-key] (if the access keys are not provided, s3-streaming-upload will attempt to retrieve them from ia's configuration file)
Make a clone of the "sreg" (stream registry) stream database where the bodies of the streams are stored instead of the pointers. Synopsis: sreg_build_backup_set <target-directory>
Go through the hashpointers in the specified directory, make sure that they are present in the stream registry, and remove any streams from the stream registry that are not referenced by the hashpointers in the specified directory. Synopsis: sreg_drop_unused [--verify] <directory>
Verify that all entries in the sreg stream database can be read correctly. Synopsis: sreg_fsck
Verify that all sreg hash pointers in the specified directory can be read correctly. Synopsis: sreg_fsck_hashpointers <path>
Mount a FUSE filesystem overlay for sreg (wrapper around Synopsis: sreg_fuse <mount-point>
Accepts a sreg pointer on stdin, and outputs the corresponding data from the stream registry. If a checksum is provided on the command line, the retrieved data will be checked against it. Synopsis: sreg_read_stream [--checksum <checksum>] [--disallow-hash-pointer]
Stores data provided on stdin into the stream registry, and sends a pointer to it to stdout. A checksum, if one is known for the stream, can be provided on the command line for a slight performance improvement. Synopsis: sreg_store_stream [--assume-checksum <checksum>]
Copy the first argument into the second and replace any enclosed sreg pointers with their contents. Synopsis: srpull <source-path> <destination-directory>
Copy the first argument into the second and replace non-pointerized or out-of-date files in the destination with their pointers. Synopsis: srsync [--verify|--no-verify] <source-path> <destination-directory>

In addition, Crystallize also provides the following scripts that it uses internally that are not supported for independent use.

Set up the bash environment shared by Crystallize tools. Synopsis: source crystallize-bash_setup
Part of crystallize that uploads the data body (not metadata). Synopsis: crystallize-internal-ia (needs specific environment variables set)
Part of crystallize that compresses a JSON metadata file. Synopsis: crystallize-internal-xz-b (needs specific environment variables set)
The main logic for crystallize. Synopsis: crystallize-logsession <log-file> <crystal-address> <file>... (needs specific environment variables set)
Create a "localstorecache" cache directory: localstorecache is a naïve caching layer for LocalStore crystals (variant of "fcache"). Synopsis: localstorecache_init <directory-name> <cache-size-limit-in-bytes> (if the cache directory already exists, the current size limit will override the one provided as an argument)
Get an item (returned as a file path) using the specified "localstorecache" cache. Synopsis: localstorecache_request <cache-directory> <crystal-address>
Drop old items from the specified (s/f/localstore)cache. Defaults to scache. Synopsis: scache_gc <cache-directory> [s|f|localstore]
Mount a FUSE filesystem overlay for sreg. Synopsis: sreg_fuse <mount-point> <sreg-directory-to-mount>
Given a LocalStore pointer, replace it with a remote pointer. Synopsis: sregi_bundle_pointer <path-to-remote-pointer-data> <path-to-pointer-to-replace>
Copy the first argument (must be a file) to the first argument appended to the destination folder, and replace it with a sreg pointer. If a tracking file (should contain only an integer) is specified, the file's value will be incremented. characters-to-trim is the number of characters to remove from the source filename to give the location of the destination file relative to the enclosing destination directory. Synopsis: sregi_copy_write [--no-verify] <path-to-file> <destination-folder> <tracking-file> <characters-to-trim>
Remove the specified pointer from the stream registry if it is not listed in the specified ID list (newline-separated list of pointer IDs). Synopsis: sregi_drop_single_unused <path-to-pointer> <path-to-ID-list>
For each file specified, if it is a sreg pointer, then replace it with the pointer's contents. Synopsis: sregi_expand_pointers <file>...
Accepts a sreg database entry as an argument, and replaces the entry with the entry's contents (but does nothing if this has already been done). Synopsis: sregi_file_backup <path-to-database-entry>
Check that the pointer corresponding to the specified hash pointer is present in the stream registry, and add the specified hash pointer to the specified ID list for use by sregi_drop_single_unused. Synopsis: sregi_hashpointer_sane <path-to-hashpointer> <path-to-ID-list> <tracking-file> [--verify]
Check that the specified pointer can be retrieved. If a tracking file (should contain only an integer) is specified, the file's value will be incremented. Synopsis: sregi_verify_entry <path-to-pointer> [tracking-file]
Check that the specified hash pointer can be retrieved. Synopsis: sreg_verify_hashpointer <path-to-pointer>

crystallize-bash_setup provides these bash functions.

Wrapper around the rubberfs script: this function should be used instead. Synopsis: Synopsis: rubberfs ( ((create|mount|soft-mount|remount|rename|cd|unmount|soft-unmount|attach|check|save|freeze|delta|gc|thaw|patch|status|list|usage-write|destroy|destroy-no-upload|historybak|historypull) [RubberFS name]) | usage | whereami | stub | (stash <file>...) )
???? Synopsis: git-absolute-path <file>
???? Synopsis: git-escape-path <path>


For Wreathe 7.3, an ebuild (app-misc/crystallize) is available in the Wreathe overlay (this may also work for similar operating systems such as Ututo XS GNU/Linux).

For other operating systems, use the following installation instructions.

Instructions for installation without ebuild


Wreathe 7.3 is required for full support. The simple invocations of the 'crystallize' and 'decrystallize' commands (with filenames as the only arguments) are also theoretically supported on Ubuntu GNU/Linux and macOS 10.12 in the interest of promoting the preservation of knowledge (although Ember strongly advises not using non-libre software such as those operating systems), and will probably work on many other UNIX-like operating systems; these instructions only cover that basic support.

While using full functionality is not supported without using the ebuild, the following additional requirements are needed for it (this list is probably incomplete/incorrect).


To download Crystallize, run:

git clone
Copy scripts

To install the downloaded scripts, run cd crystallize; make.


Edit the configuration file; see the "Configuration file format" section for documentation of this.

Finally, run sudo make install.

Configuration file format

The configuration file is located in your system configuration directory (probably /usr/local/etc or /etc), and is named crystallize.conf. It is a list of key-value pairs in the format Key,Value, separated by a line feed (0x0A), as follows:

Installation UUID
Internet Archive collection identifier (write access to the collection is required)
Passphrase (must be a valid GPG passphrase)
Directory for working data (should be writeable and have sufficient free space to hold approximately three times the amount of data being crystallized at any one time)
Path to a directory tree of the format used by the Ember Library

Note that there is currently no facility for storing configuration values containing line feeds.


To learn about contributing to this project, visit the development page.