Crontab does not work properly Crontab does not work properly docker docker

Crontab does not work properly


The error message you see already tries to explain what's wrong. As you specified -t to the exec command, it tries to allocate a TTY. When run from cron, there is no pseudo-TTY available and thus it fails.

Try to change your script to this:

#!/bin/bash/usr/bin/docker restart container_name 2>/dev/null/usr/bin/docker exec -i container_name /path/launcher.sh 2>/dev/null

FYI: There are a lot of questions regarding cron and TTY here. For example, this one explains the problem pretty well: "stdin: is not a tty" from cronjob