# Restic Configuration Reference

 The `k8up restic` module used to be a component called wrestic. Their repositories were merged in 2021.

## Arguments and Environment Variables

The required arguments depend on the actions that should be performed.

• The environment variable `RESTIC_PASSWORD` must always be defined. It is not used by `k8up restic` directly, but it is used when the actual `restic` binary is invoked.

• The argument `--resticRepository` must always be defined.

• If `--prune` is set, then all the `--keepWithin*` arguments need to be valid and positive durations, see the respective Go documentation.

• If `--prune` is set, then all the other `--keep*` arguments (except `--keepTags`) need to be positive numbers (integers).

• If `--restore` is set, then `--restoreType` must be defined as well.

• If `--restore` is set and `--restoreType` is set to `s3`, then all the `--restoreS3*` arguments have to be defined as well.

See `k8up restic --help` for all the options:

``````NAME:
k8up restic

USAGE:
k8up restic [command options] [arguments...]

CATEGORY:
backup

DESCRIPTION:
Start k8up in restic mode

OPTIONS:
--archive                             Set, if the container should do an archive (default: false)
--backupCommandAnnotation value       Defines the command to invoke when doing a backup via STDOUT. [$BACKUPCOMMAND_ANNOTATION] --backupDir value Set from which directory the backup should be performed. (default: "/data") [$BACKUP_DIR]
--check                               Set, if the container should do a check (default: false)
--fileExtensionAnnotation value       Defines the file extension to use for STDOUT backups. [$FILEEXTENSION_ANNOTATION] --keepDaily value While pruning, keep daily snapshots (default: 0) [$KEEP_DAILY]
--keepHourly value                    While pruning, keep hourly snapshots (default: 0) [$KEEP_HOURLY] --keepLatest value While pruning, keep at the latest snapshot (default: 0) [$KEEP_LAST, $KEEP_LATEST] --keepMonthly value While pruning, keep monthly snapshots (default: 0) [$KEEP_MONTHLY]
--keepTags                            While pruning, keep tagged snapshots (default: false) [$KEEP_TAG,$KEEP_TAGS]
--keepWeekly value                    While pruning, keep weekly snapshots (default: 0) [$KEEP_WEEKLY] --keepWithin value While pruning, keep tagged snapshots within the given duration, e.g. '2y5m7d3h' [$KEEP_WITHIN]
--keepWithinDaily value               While pruning, keep daily snapshots within the given duration, e.g. '2y5m7d3h' [$KEEP_WITHIN_DAILY] --keepWithinHourly value While pruning, keep hourly snapshots within the given duration, e.g. '2y5m7d3h' [$KEEP_WITHIN_HOURLY]
--keepWithinMonthly value             While pruning, keep monthly snapshots within the given duration, e.g. '2y5m7d3h' [$KEEP_WITHIN_MONTHLY] --keepWithinWeekly value While pruning, keep weekly snapshots within the given duration, e.g. '2y5m7d3h' [$KEEP_WITHIN_WEEKLY]
--keepWithinYearly value              While pruning, keep yearly snapshots within the given duration, e.g. '2y5m7d3h' [$KEEP_WITHIN_YEARLY] --keepYearly value While pruning, keep yearly snapshots (default: 0) [$KEEP_YEARLY]
--promURL value                       Sets the URL of a prometheus push gateway to report metrics. [$PROM_URL] --prune Set, if the container should do a prune (default: false) --resticBin value The path to the restic binary. (default: "/usr/local/bin/restic") [$RESTIC_BINARY]
--resticOptions value                 Additional options to pass to restic in the format 'key=value,key2=value2' [$RESTIC_OPTIONS] --resticRepository value The restic repository to perform the action with [$RESTIC_REPOSITORY]
--restore                             Set, if the container should attempt a restore (default: false)
--restoreDir value                    Set to which directory the restore should be performed. (default: "/data") [$RESTORE_DIR] --restoreFilter value Simple filter to define what should get restored. For example the PVC name --restoreS3AccessKey value S3 access key used to connect to the S3 endpoint when restoring [$RESTORE_ACCESSKEYID]
--restoreS3Endpoint value             S3 endpoint to connect to when restoring, e.g. 'https://minio.svc:9000/backup [$RESTORE_S3ENDPOINT] --restoreS3SecretKey value S3 secret key used to connect to the S3 endpoint when restoring [$RESTORE_SECRETACCESSKEY]
--restoreSnap value                   Snapshot ID, if empty takes the latest snapshot
--restoreType value                   Type of this restore, 'folder' or 's3'
--tag value                           List of tags to consider for given operation  (accepts multiple inputs)
--trimRestorePath                     If set, strips the value of --restoreDir from the lefts side of the remote restore path value (default: enabled) [$TRIM_RESTOREPATH] --verifyRestore If the restore should get verified, only for PVCs restore (default: false) --webhookURL value, --statsURL value Sets the URL of a server which will retrieve a webhook after the action completes. [$STATS_URL]``````