aboutsummaryrefslogtreecommitdiffstats
path: root/lifeboat.1
blob: f7fe7105476f3703ad77276f78ee8b82a1f91952 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
.Dd October 3, 2019
.Dt LIFEBOAT 1
.Os
.Sh NAME
.Nm lifeboat
.Nd manage and automate local restic backups
.Sh SYNOPSIS
.Nm
.Ar repo
.Ar command
.Sh DESCRIPTION
.Nm
is a program that manages a set of local
.Xr restic 1
repositories and provides a framework
for automating the creation and synchronization of backups.
.Pp
The command is any command recognized by
.Xr restic 1 ,
or as follows:
.Bl -tag -width Ds
.It Sy run
Create a snapshot for the specified repository.
.El
.Sh DIRECTORY STRUCTURE
.Nm
keeps all its data in one directory, specified by the
.Ev LIFEBOAT_ROOT
environment variable.
If unset,
.Nm
will fall back to
.Pa /srv/backup/lifeboat .
.Pp
Each backup managed by
.Nm
owns a directory under
.Ev LIFEBOAT_ROOT .
In that directory, the program expects the following:
.Bl -tag -width Ds
.It Sy repo/
A directory containing the actual
.Xr restic 1
repository.
.It Sy credentials/restic
A file containing the password for the
.Xr restic 1
repository.
.It Sy run
A shell script containing backup jobs.
.It Sy post
A shell script containing post-backup jobs, optional.
.It Sy sync
A shell script containing synchronization jobs, optional.
.El
.Pp
When
.Nm
is invoked with the
.Em run
command, it will change the current directory to the backup directory, and execute the
.Em run
script, followed by executing
.Em post
and
.Em sync ,
if they exist.
.Sh ENVIRONMENT
.Nm
will export the following environment variables for use in the
.Em run ,
.Em post ,
and
.Em sync
scripts:
.Bl -tag -width Ds
.It Sy LIFEBOAT_REPO
The name of the backup as specified on the command line.
.It Sy RESTIC_REPOSITORY
The path to the
.Xr restic 1
repository.
.It Sy RESTIC_PASSWORD_FILE
The path to the
.Xr restic 1
password file.
.El
.Sh SEE ALSO
.Xr restic 1
.Sh AUTHORS
.An -nosplit
.Nm
was written by
.An Wolfgang Müller Aq Mt vehk@vehk.de