-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbackup-service.tf
76 lines (62 loc) · 1.73 KB
/
backup-service.tf
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
job "osticket_backup" {
type = "batch"
periodic {
cron = "@daily"
}
reschedule {
attempts = 0
unlimited = false
}
datacenters = ["MyDatacenter"]
group "osticket-backup" {
volume "osticket_db" {
type = "host"
read_only = false
source = "osticket_db"
}
volume "borg_config" {
type = "host"
read_only = false
source = "borg_config"
}
volume "borg_repo" {
type = "host"
read_only = false
source = "borg_repo"
}
task "osticket-backup-db" {
driver = "docker"
user = "root"
config {
image = "pschiffe/borg"
force_pull = false
}
volume_mount {
volume = "osticket_db"
destination = "/data" #<-- in the container
read_only = false
}
volume_mount {
volume = "borg_config"
destination = "/root" #<-- in the container
read_only = false
}
volume_mount {
volume = "borg_repo"
destination = "/opt/borg" #<-- in the container
read_only = false
}
env {
BORG_REPO="/opt/borg"
BORG_PASSPHRASE="mypassword"
BACKUP_DIRS="/data"
ARCHIVE="${NOMAD_SHORT_ALLOC_ID}"
COMPRESSION="lz4"
PRUNE=1
KEEP_DAILY=7
KEEP_WEEKLY=1
KEEP_MONTHLY=1
}
}
}
}