5
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

pyenv 環境の Django コマンドを cron で動かす

5
Posted at

ちょっとハマったのでメモ。

/var/www/example 以下に pyenv 環境が適用される状況

cd /var/www/example
pyenv local example

crontab を編集

/etc/crontab
BASE_DIR=/var/www/example

* * * * * user cd $BASE_DIR/myapp && /usr/local/pyenv/shims/python manage.py command

python のパスは which python で調べる

5
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?