Skip to content

Instantly share code, notes, and snippets.

@peace098beat
Last active March 22, 2022 06:41
Show Gist options
  • Save peace098beat/952d932827f996eacc6c2ac837ad499c to your computer and use it in GitHub Desktop.
Save peace098beat/952d932827f996eacc6c2ac837ad499c to your computer and use it in GitHub Desktop.
[CRON]
[dockerコマンドをcronで実行させたら「TTYが無いよ」と怒られた件 | Hodalog](https://hodalog.com/how-to-resolve-the-error-that-the-input-device-is-not-a-tty/)
- docker-compose
- [cron駆動のdocker(docker-compose) execが走らない問題の対応 - Qiita](https://qiita.com/chankame/items/a939c8653e0e4845fc8a)
- docker-compose exec -T app date
# [crontabの書き方 | server-memo.net](https://www.server-memo.net/tips/crontab.html)
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
HOME=/
* * * * * date >> /home/ubuntu/batch-ml-video-feedback/logs/cron-log-ubuntu.log
* * * * * sh /<FULLPATH>/endpoint.sh >> /<FULLPATH>/logs/endpoint.log 2>&1
# A) `2>&1` を付与してエラーログも吐き出す
# これがないとエラーで動かない場合に気がつけない
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment