2022-07-28 00:02:29 +00:00
|
|
|
job "lldap" {
|
|
|
|
schedule = "* * * * *"
|
|
|
|
|
|
|
|
config {
|
|
|
|
# TODO: Backup to a meaningful location, this is just for testing
|
|
|
|
repo = "/local/repo"
|
|
|
|
# Read from secret file
|
|
|
|
passphrase = env("BACKUP_PASSPHRASE")
|
|
|
|
}
|
|
|
|
|
|
|
|
# Remove when using a proper backup destination
|
|
|
|
task "Create dir for repo" {
|
|
|
|
pre_script {
|
|
|
|
on_backup = "echo 'Backing up something'"
|
|
|
|
}
|
|
|
|
pre_script {
|
|
|
|
on_backup = "mkdir -p /local/repo"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-07-28 00:25:41 +00:00
|
|
|
# sqlite "Backup database" {
|
|
|
|
# path = "/data/lldap/users.db"
|
|
|
|
# # sqlite3 /data/lldap/users.db .backup /data/lldap/users.db.bak
|
|
|
|
# dump_to = "/data/lldap/users.db.bak"
|
|
|
|
# }
|
2022-07-28 00:02:29 +00:00
|
|
|
|
|
|
|
backup {
|
|
|
|
paths = ["/data/lldap"]
|
|
|
|
# Because path is absolute
|
|
|
|
restore_opts {
|
|
|
|
Target = "/"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
forget {
|
|
|
|
KeepLast = 2
|
|
|
|
Prune = true
|
|
|
|
}
|
|
|
|
}
|