I am using docker swarm to control a deployment with several containers used for a machine learning application.
I have a bash script which sends commands to be executed by some containers. When I do execute this script manually in the console, everything works fine, the commands are sent to the containers and run BUT when I added this same script to be executed by the cron, it doesn't work (I am using the crontab -e command so the script be executed with my user)
Here's one example of scripts we need to run:
eval $(docker-machine env --swarm director)
docker exec -d container_luigi-worker_1 luigi --module etl AllTasks
And the cron line is: 16 * * * * sh /path/script.sh
As we are using swarm, first we need to get into the env of the director, then we execute the command using docker exec (in this case is a command to start a job using spotify's luigi tool)
What am I missing? thanks