前回、
じゃらんの東京ビジネスホテルの今日の金額を毎朝7時に取得してテキスト出力するというプログラムを作成した
しかし、今朝の7時に実行されていなかった
原因
cronは通常のターミナル環境を引き継がないため
| 修正前 | 修正後 |
| 0 7 * * * /Users/hiroki/プログラミング成果物/python/venv/bin/python /Users/hiroki/プログラミング成果物/python/hotel.py >> ~/hotel_log.txt 2>&1 | 0 4 * * * /Users/hiroki/プログラミング成果物/python/venv/bin/python /Users/hiroki/プログラミング成果物/python/hotel/hotel.py >> /Users/hiroki/プログラミング成果物/python/hotel/hotel_log.txt 2>&1 |

明日の朝4時に上手く行くか?
それを確認しよう
上手く行ったら、python/hotel/hotel_log.txtに明日の価格が追記される

最新のソースコード
hotelディレクトリを作成した

python/hotel at main · ki-hi-ro/python
続編
カテゴリー:技術・開発
