ofelia
ofelia copied to clipboard
job-exec with swarm container
I want to execute mongodump
in a swarm container @daily
.
As you know, swarm containers are named randomly.
how does this work with ofelia? Is there some kind of filter available, like we use to do this ?
docker ps -f name=mongo1
[job-exec "mongodump"]
schedule = @daily
container = mongo_mongo1.1.f0dmbbmxwza22tzqfhnopzt3f
command = mongodump
you see, that cant go well for very long ...
Hey @port22
there is no exec
for swarm jobs. But what you can try is something like
[job-service-run "mongodump"]
schedule = @daily
image = mongo
network = mongo_network
command = mongodump -h mongo ...
this will create another swarm service, so you need to make sure it can connect to your Mongo DB.
Not sure if it will satisfy your requirement, but I think that is the only option for now.
hey thanks for that fast answer!
That was actually my first try, but how do I mount a volume into that freshly created service? for the dumps output ...
I was afraid you would ask that 😅
Ofelia has no support of mounting volumes yet, unfortunately. #70
the same issue