DEV Community

Cover image for Encountering 'the input device is not a TTY' When Running Docker Command with Cron
Kenta Takeuchi
Kenta Takeuchi

Posted on • Originally published at bmf-tech.com

Encountering 'the input device is not a TTY' When Running Docker Command with Cron

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
Enter fullscreen mode Exit fullscreen mode

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)