Files
NomadBackup/nomad_backup/qautomate.hcl
2025-11-21 21:10:40 +00:00

59 lines
1.0 KiB
HCL

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"
}
}
}
}