Environment variable equivalent to s3.storage-class

This may be something that’s so obvious that I am missing, but after going through the latest documentation and searching the forum I can’t find it. I apologise in advance if this is super obvious.

Is it possible to specify the s3.storage-class option for restic in an environment variable, instead of the command line?

no. but if you use the rclone backend for s3 you can:

It is a possible solution, but I don’t particularly like it because it has more moving parts.

Lacking a proper environment variable, I think I will go the route of using this in my variables file:

STORAGE_CLASS=STANDARD
EXTRA_CMD_LINE_ARGS="-o s3.storage-class=$STORAGE_CLASS"

and this in my restic command file:

source variable-file.sh
.
.
.
$RESTIC $EXTRA_CMD_LINE_ARGS $*

If it was some secret credential I would call shenanigans, but it’s not a sensitive enough piece of data to protect from showing up on the command line.

2 Likes