Skip to content

Command line

Every command takes --data-dir PATH, the directory holding the store, data by default. leblob --help lists the commands, leblob COMMAND --help describes one, and leblob --version prints the version.

Command What it does
serve Run the S3 server
key Manage access keys
volume Manage the disks blobs are stored on
backup Copy the metadata to a new file, while the server may be running
restore Put a backup in place of lost metadata
fsck Compare the metadata with the disk
scrub Check every copy against its MD5 now

serve

leblob serve [OPTIONS]

Runs the S3 server. It creates the store if the directory holds none, and on the first start creates an access key and prints it once.

Option Default Meaning
--data-dir PATH data Directory holding all stored data
--host STR 127.0.0.1 Address to listen on
--port INT 9000 Port to listen on
--workers INT number of CPUs, 4 at most Number of worker processes. Each takes about 30 MiB. Writes wait on the disk and gain nothing from more; reads do
--domain STR none Base domain enabling virtual-hosted addressing (bucket.domain)
--ssl-certfile PATH none TLS certificate, to serve HTTPS directly
--ssl-keyfile PATH none TLS private key
--shutdown-grace INT 20 Seconds to let requests finish on shutdown. Without a limit, one client that stops reading would prevent the server from ever exiting
--lifecycle-day-seconds INT 86400 How long a day lasts for lifecycle rules. For tests, which can't wait for one
--allow-sse-c-over-http / --no-allow-sse-c-over-http off Accept encryption keys over plain HTTP. Only behind a proxy that terminates TLS, or for tests: otherwise the key can be read off the network

See Running in production.

key

leblob key COMMAND

Manages access keys. A key has full access unless created as scoped. A scoped key has no rights until granted some, per bucket. See Access keys.

key create

leblob key create [--scoped] [--data-dir PATH]

Creates an access key and prints it. The secret isn't shown again.

Option Default Meaning
--scoped / --no-scoped off Give the key no rights until key grant gives it some, instead of full access

key list

leblob key list [--data-dir PATH]

Lists access keys and what each may do.

key delete

leblob key delete ACCESS_KEY [--data-dir PATH]

Deletes an access key.

key grant

leblob key grant ACCESS_KEY BUCKET LEVEL [--data-dir PATH]

Gives a scoped key a level on a bucket, replacing any it had. LEVEL is read, write (which includes read) or admin (which includes write).

key revoke

leblob key revoke ACCESS_KEY BUCKET [--data-dir PATH]

Removes what a scoped key was granted on a bucket.

volume

leblob volume COMMAND

Manages the disks blobs are stored on. A running server follows each change within a couple of minutes. See Disks and copies.

volume list

leblob volume list [--data-dir PATH]

Lists volumes, with how full each is and any that can't be used.

volume add

leblob volume add PATH [--data-dir PATH]

Adds a volume for new blobs. PATH is an existing empty directory, usually the mount point of a disk. With one copy of each blob, losing a volume loses the objects with blobs on it: see volume copies.

volume copies

leblob volume copies COUNT [--data-dir PATH]

Sets how many volumes hold each blob, at most the number of volumes. A running server adds the missing copies of blobs already stored, and leaves extra ones in place. Each copy needs its own disk to protect against losing one.

volume drain

leblob volume drain VOLUME_ID [--data-dir PATH]

Stops using a volume, and has a running server move its blobs elsewhere. volume list shows when it is empty, and volume forget then removes it.

volume forget

leblob volume forget VOLUME_ID [--disk-lost] [--accept-loss] [--data-dir PATH]

Removes a volume that is empty, or whose disk is gone for good.

Option Default Meaning
--disk-lost / --no-disk-lost off The disk is gone: forget the copies on it, for a running server to replace
--accept-loss / --no-accept-loss off Go ahead even though some blobs have no other copy, losing their objects

backup

leblob backup DESTINATION [--data-dir PATH]

Copies the metadata to a new file, while the server may be running. DESTINATION is the file to create; put it on another disk. The file holds the access keys' secrets. Without it, losing the metadata loses every object, because blob files have random names. It doesn't hold the blobs. See Backup and restore.

restore

leblob restore BACKUP_FILE [--data-dir PATH]

Puts a backup made by leblob backup in place of lost metadata. Stop the server first. Objects written since the backup are lost. Their files become orphans. Blobs collected since then are missing, which can only happen once the backup is older than the collector's grace period, an hour. fsck reports both.

fsck

leblob fsck [--delete-orphans] [--data-dir PATH]

Compares the metadata with the disk, and exits non-zero if they disagree.

Option Default Meaning
--delete-orphans / --no-delete-orphans off Remove blob files that have no metadata and are over a day old

scrub

leblob scrub [--data-dir PATH]

Checks every copy against its MD5 now, at full speed. A running server does this slowly anyway. A bad copy is removed, and a running server replaces it. Exits non-zero if a blob's only copy is bad.