Command-line interface

swh objstorage

Software Heritage Objstorage tools.

swh objstorage [OPTIONS] COMMAND [ARGS]...


-C, --config-file <config_file>

Configuration file.


Check the objstorage is not corrupted.

swh objstorage fsck [OPTIONS]


Import a local directory in an existing objstorage.

swh objstorage import [OPTIONS] DIRECTORY...



Required argument(s)


Fill a destination Object Storage using a journal stream.

This is typically used for a mirror configuration, by reading a Journal and retrieving objects from an existing source ObjStorage.

There can be several ‘replayers’ filling a given ObjStorage as long as they use the same group-id. You can use the KAFKA_GROUP_INSTANCE_ID environment variable to use KIP-345 static group membership.

This service retrieves object ids to copy from the ‘content’ topic. It will only copy object’s content if the object’s description in the kafka nmessage has the status:visible set.

--exclude-sha1-file may be used to exclude some hashes to speed-up the replay in case many of the contents are already in the destination objstorage. It must contain a concatenation of all (sha1) hashes, and it must be sorted. This file will not be fully loaded into memory at any given time, so it can be arbitrarily large.

--check-dst sets whether the replayer should check in the destination ObjStorage before copying an object. You can turn that off if you know you’re copying to an empty ObjStorage.

swh objstorage replay [OPTIONS]


-n, --stop-after-objects <stop_after_objects>

Stop after processing this many objects. Default is to run forever.

--exclude-sha1-file <exclude_sha1_file>

File containing a sorted array of hashes to be excluded.

--check-dst, --no-check-dst

Check whether the destination contains the object before copying.


Run a standalone objstorage server.

This is not meant to be run on production systems.

swh objstorage rpc-serve [OPTIONS]


--host <IP>

Host ip address to bind the server on


-p, --port <PORT>

Binding port of the server