6
9

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.

cronでpipenv環境上ジョブを実行する

Posted at

背景

動作確認などで、pipenv環境上のジョブをcron経由で実行する

やり方

対象の環境で pipenv shell を打った時の以下の出力をコピペしておく


$ pipenv shell
> Launching subshell in virtual environment…
> . /<path>/<to>/<virtualenv>/bin/activate

上記の . /<path>/<to>/<virtualenv>/bin/activate を含めた以下のようなcronで動く

42 * * * * cd /path/to/project/;. /<path>/<to>/<virtualenv>/bin/activate;python main.py

参考

How to run a cron job with pipenv?

6
9
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
6
9

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?