Backrest is a web-accessible backup solution built on top of restic. Backrest provides a WebUI which wraps the restic CLI and makes it easy to create repos, browse snapshots, and restore files. Additionally, Backrest can run in the background and take an opinionated approach to scheduling snapshots and orchestrating repo health operations. Approved by: acm (mentor)
36 lines
1.2 KiB
Bash
36 lines
1.2 KiB
Bash
#!/bin/sh
|
|
|
|
# PROVIDE: backrest
|
|
# REQUIRE: LOGIN
|
|
# KEYWORD: shutdown
|
|
#
|
|
# Configuration settings for backrest in /etc/rc.conf
|
|
#
|
|
# backrest_enable (bool): Enable backrest. (Default=NO)
|
|
# backrest_env_file (str): Path containing the environment variables
|
|
# to be used by backrest. (Default: %%ETCDIR%%/config.env)
|
|
# backrest_logfile (str): Log file used to store the backrest's output. (Default: /var/log/backrest.log)
|
|
# backrest_pidfile (str): File used by backrest to store the process ID. (Default: /var/run/backrest.pid)
|
|
# backrest_runas (str): User to run backrest as. (Default: %%USER%%)
|
|
|
|
. /etc/rc.subr
|
|
|
|
name="backrest"
|
|
desc="Web UI and orchestrator for restic backup"
|
|
rcvar="backrest_enable"
|
|
|
|
load_rc_config $name
|
|
|
|
: ${backrest_enable:="NO"}
|
|
: ${backrest_env_file:="%%ETCDIR%%/config.env"}
|
|
: ${backrest_logfile:="/var/log/backrest.log"}
|
|
: ${backrest_pidfile:="/var/run/backrest.pid"}
|
|
: ${backrest_runas:="%%USER%%"}
|
|
|
|
pidfile="${backrest_pidfile}"
|
|
procname="%%LOCALBASE%%/bin/backrest"
|
|
command="/usr/sbin/daemon"
|
|
command_args="-o '${backrest_logfile}' -p '${pidfile}' -u '${backrest_runas}' -t '${desc}' -- '${procname}'"
|
|
|
|
run_rc_command "$1"
|