Using the Java Command-Line Interface

The Java Command Line Interface (CLI) is a simple but powerful Spectra S3 client for BlackPearl. As the name implies, it allows users to manage files in BlackPearl using a simple command-line interface. The Java CLI, which is both free and open source, was created by Spectra Logic using our Java Software Development Kit and works on Windows, Mac, and Linux.

We have created a Java CLI Reference and Examples page to assist you with using the Java CLI. We find that one of the most common uses of the Java CLI by our customers is moving files to BlackPearl on some periodic basis using a scheduled task or cron job. Our examples therefore show how to use the Java CLI and 7zip (7zip.org) to zip and move files to BlackPearl. The files can then be retrieved from BlackPearl if needed using the Java CLI or the Deep Storage Browser (formerly DS3 Browser) -- another free and open-source Spectra S3 client created by Spectra Logic.

The Java CLI works like many other command line interfaces. There is a base call (ds3_java_cli) with options to control behavior. There are a total of 13 different commands currently available in the CLI. Here is an example of Java CLI command to move a folder from a server to BlackPearl:

ds3_java_cli -e bp1.acmecorp.com -a amVmZmJy -k iYkqUwcd -c put_bulk -b bucket1 -d “c:\Temp\subdir1”

In this example, the command put_bulk is used to move server directory subdir1 to a bucket called bucket1 on the BlackPearl located at bp1.acmecorp.com. The -a is the BlackPearl user’s S3 Access ID and the -k is the user’s S3 Secret Key.

You can optionally set system environment variables for the S3 Access ID (-a), S3 Secret Key (-k), endpoint (-e) and HTTP proxy (-x, not shown).

There are more examples and information located on the Java CLI Reference and Examples page. As always, if you have any questions or need assistance, please use our Forum or Contact Us.

Leave a Reply

You must be logged in to post a comment.