restic-scheduler/config.hcl

74 lines
997 B
HCL
Raw Normal View History

2022-02-23 00:39:01 +00:00
// Example job file
job "MyApp" {
2022-02-20 06:09:23 +00:00
schedule = "* * * * *"
config {
repo = "s3://..."
passphrase = "foo"
2022-02-23 00:39:01 +00:00
env = {
"foo" = "bar",
}
options {
VerboseLevel = 3
}
2022-02-20 06:09:23 +00:00
}
2022-02-23 00:39:01 +00:00
mysql "DumpMainDB" {
hostname = "foo"
username = "bar"
}
sqlite "DumpSqlite" {
path = "/db/path"
2022-02-20 06:09:23 +00:00
}
2022-02-23 00:39:01 +00:00
task "RunSomePreScripts" {
script {
on_backup = <<EOF
2022-02-20 06:09:23 +00:00
echo foo > /biz.txt
EOF
2022-02-23 00:39:01 +00:00
on_restore = "/foo/bar.sh"
}
script {
on_backup = <<EOF
echo bar >> /biz.txt
EOF
}
}
task "ActuallyBackupSomeStuff" {
backup {
files =[
"/foo/bar",
"/biz.txt",
]
backup_opts {
Tags = ["service"]
}
restore_opts {
Verify = true
}
}
}
task "RunSomePostScripts" {
script {
on_backup = <<EOF
rm /biz.txt
EOF
2022-02-20 06:09:23 +00:00
}
}
2022-02-23 00:39:01 +00:00
forget {
KeepLast = 3
KeepWeekly = 2
KeepMonthly = 2
KeepYearly = 2
Prune = true
2022-02-20 06:09:23 +00:00
}
}