docker exec is not working in cron
The docker exec command says it needs "pseudo terminal and runs in interactive mode" (-it flags) while cron doesn't attach to any TTYs.
Try using the -d flag instead of -it:
# /bin/sh -c "/usr/bin/docker exec -u root -d exp_mongo_1 /bin/sh /backup.sh"
Reference:
https://stackoverflow.com/questions/37089033/docker-exec-is-not-working-in-cron
Saturday, September 9, 2017
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment