65 lines
1.5 KiB
HCL
65 lines
1.5 KiB
HCL
job "radarr" {
|
|
schedule = "@daily"
|
|
|
|
config {
|
|
repo = "s3://backups-minio.agnosticfront.thefij:8443/nomad/radarr"
|
|
passphrase = env("BACKUP_PASSPHRASE")
|
|
|
|
options {
|
|
InsecureTls = true
|
|
}
|
|
}
|
|
|
|
task "Backup main database" {
|
|
postgres "Backup database" {
|
|
hostname = env("POSTGRES_HOST")
|
|
port = env("POSTGRES_PORT")
|
|
username = env("POSTGRES_USER")
|
|
password = env("POSTGRES_PASSWORD")
|
|
database = "radarr"
|
|
no_tablespaces = true
|
|
dump_to = "/data/nas-container/radarr/Backups/dump-radarr.sql"
|
|
}
|
|
}
|
|
|
|
task "Backup logs database" {
|
|
postgres "Backup database" {
|
|
hostname = env("POSTGRES_HOST")
|
|
port = env("POSTGRES_PORT")
|
|
username = env("POSTGRES_USER")
|
|
password = env("POSTGRES_PASSWORD")
|
|
database = "radarr-logs"
|
|
no_tablespaces = true
|
|
dump_to = "/data/nas-container/radarr/Backups/dump-radarr-logs.sql"
|
|
}
|
|
}
|
|
|
|
backup {
|
|
paths = ["/data/nas-container/radarr"]
|
|
|
|
backup_opts {
|
|
Exclude = [
|
|
"radarr_backup_*.zip",
|
|
"/data/nas-container/radarr/MediaCover",
|
|
"/data/nas-container/radarr/logs",
|
|
]
|
|
Host = "nomad"
|
|
}
|
|
|
|
restore_opts {
|
|
Host = ["nomad"]
|
|
# Because path is absolute
|
|
Target = "/"
|
|
}
|
|
}
|
|
|
|
forget {
|
|
KeepLast = 2
|
|
KeepDaily = 30
|
|
KeepWeekly = 8
|
|
KeepMonthly = 6
|
|
KeepYearly = 2
|
|
Prune = true
|
|
}
|
|
}
|