2023-08-03 16:55:00 +00:00
|
|
|
job "lidarr" {
|
|
|
|
schedule = "@daily"
|
|
|
|
|
|
|
|
config {
|
|
|
|
repo = "rclone::ftp,env_auth:/nomad/lidarr"
|
|
|
|
passphrase = env("BACKUP_PASSPHRASE")
|
|
|
|
}
|
|
|
|
|
|
|
|
task "Backup main database" {
|
|
|
|
postgres "Backup database" {
|
2023-08-29 19:52:26 +00:00
|
|
|
hostname = env("POSTGRES_HOST")
|
|
|
|
port = env("POSTGRES_PORT")
|
|
|
|
username = env("POSTGRES_USER")
|
|
|
|
password = env("POSTGRES_PASSWORD")
|
2023-08-03 16:55:00 +00:00
|
|
|
database = "lidarr"
|
|
|
|
no_tablespaces = true
|
|
|
|
dump_to = "/data/nas-container/lidarr/Backups/dump-lidarr.sql"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
task "Backup logs database" {
|
|
|
|
postgres "Backup database" {
|
2023-08-29 19:52:26 +00:00
|
|
|
hostname = env("POSTGRES_HOST")
|
|
|
|
port = env("POSTGRES_PORT")
|
|
|
|
username = env("POSTGRES_USER")
|
|
|
|
password = env("POSTGRES_PASSWORD")
|
2023-08-03 16:55:00 +00:00
|
|
|
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
|
|
|
|
}
|
|
|
|
}
|