This article was originally published on bmf-tech.com.
Overview
When I tried to run a docker command with cron, I encountered the error "the input device is not a TTY".
An example of what I tried to set in cron is as follows:
* * * * * user docker exec -it container-name mysqldump dbname -uuser -ppassword > backup.sql
Cause
The -t option assigns a TTY, and -i opens standard input, but these are unnecessary for cron execution.
Solution
Removing the -it options resolves the issue.
Top comments (0)