chore: backup Nomad jobs [skip ci]
This commit is contained in:
59
nomad_backup/qautomate.hcl
Normal file
59
nomad_backup/qautomate.hcl
Normal file
@@ -0,0 +1,59 @@
|
||||
job "qautomate" {
|
||||
periodic {
|
||||
cron = "*/30 * * * *"
|
||||
prohibit_overlap = true
|
||||
}
|
||||
datacenters = ["dc1"]
|
||||
|
||||
type = "batch"
|
||||
|
||||
group "app" {
|
||||
count = 1
|
||||
|
||||
task "setup" {
|
||||
driver = "docker"
|
||||
|
||||
lifecycle {
|
||||
hook = "prestart"
|
||||
}
|
||||
|
||||
config {
|
||||
image = "ghcr.io/sstent/ubuntu-python3"
|
||||
// command = "/bin/bash"
|
||||
args = ["-v","-c", "/local/prestart.sh"]
|
||||
|
||||
}
|
||||
|
||||
template {
|
||||
data = <<EOH
|
||||
#!/bin/bash
|
||||
rm /usr/lib/python3.11/EXTERNALLY-MANAGED
|
||||
pip3 install qbittorrent-api --upgrade
|
||||
python3 /local/torrent_tagger.py
|
||||
python3 /local/torrent_tidy.py
|
||||
|
||||
EOH
|
||||
perms = 0777
|
||||
destination = "local/prestart.sh"
|
||||
}
|
||||
|
||||
template {
|
||||
change_mode = "restart"
|
||||
data = "{{ key \"functions/torrent_tagger\" }}"
|
||||
destination = "local/torrent_tagger.py"
|
||||
}
|
||||
|
||||
template {
|
||||
change_mode = "restart"
|
||||
data = "{{ key \"functions/torrent_tidy\" }}"
|
||||
destination = "local/torrent_tidy.py"
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user