Ian Fijolek
d8f8884cb8
Add lidarr, fix hosts to 'nomad' since host names change with containers and nodes and don't make a difference, make most jobs daily, exclude sonarr and lidarr zip backups from restic backups.
57 lines
1.3 KiB
HCL
57 lines
1.3 KiB
HCL
job "lidarr" {
|
|
schedule = "@daily"
|
|
|
|
config {
|
|
repo = "rclone::ftp,env_auth:/nomad/lidarr"
|
|
passphrase = env("BACKUP_PASSPHRASE")
|
|
}
|
|
|
|
task "Backup main database" {
|
|
postgres "Backup database" {
|
|
hostname = env("MYSQL_HOST")
|
|
port = env("MYSQL_PORT")
|
|
username = env("MYSQL_USER")
|
|
password = env("MYSQL_PASSWORD")
|
|
database = "lidarr"
|
|
no_tablespaces = true
|
|
dump_to = "/data/nas-container/lidarr/Backups/dump-lidarr.sql"
|
|
}
|
|
}
|
|
|
|
task "Backup logs database" {
|
|
postgres "Backup database" {
|
|
hostname = env("MYSQL_HOST")
|
|
port = env("MYSQL_PORT")
|
|
username = env("MYSQL_USER")
|
|
password = env("MYSQL_PASSWORD")
|
|
database = "lidarr-logs"
|
|
no_tablespaces = true
|
|
dump_to = "/data/nas-container/lidarr/Backups/dump-lidarr-logs.sql"
|
|
}
|
|
}
|
|
|
|
backup {
|
|
paths = ["/data/nas-container/lidarr"]
|
|
|
|
backup_opts {
|
|
Exclude = ["lidarr_backup_*.zip"]
|
|
Host = "nomad"
|
|
}
|
|
|
|
restore_opts {
|
|
Host = ["nomad"]
|
|
# Because path is absolute
|
|
Target = "/"
|
|
}
|
|
}
|
|
|
|
forget {
|
|
KeepLast = 2
|
|
KeepDaily = 30
|
|
KeepWeekly = 8
|
|
KeepMonthly = 6
|
|
KeepYearly = 2
|
|
Prune = true
|
|
}
|
|
}
|