洗濯終了を通知する話 その5
さて、ここまでの4回でシステムの設置、プログラムの稼働が完了した。 いままでのあらすじ はこちら その1 その2 その3 その4 あとはこれを常に動かしつつ、終了した後に再稼働するようにしなければならない。 ここで調べて出てきたのがcronである。 これは定期的にプログラムを起動してくれるものらしい。 時間を設定して定期的に再起動したり、ということに使用されるようだ。 今回はこれを利用して前回作成したPythonのプログラムを1分ごとに起動してもらうことにした。 まずはターミナルで以下を入力する crontab -e ちなみに、この編集の仕方は隣の『r』を押してcrontabを削除(remove)してしまう事故を誘発するため、あまり推奨されないらしい。 が、関係なくやっていく。 開くとこのような画面になるので、 # Edit this file to introduce tasks to be run by cron. # # Each task to run has to be defined through a single line # indicating with different fields when the task will be run # and what command to run for the task # # To define the time you can provide concrete values for # minute (m), hour (h), day of month (dom), month (mon), # and day of week (dow) or use '*' in these fields (for 'any'). # # Notice that tasks will be started based on the cron's system # daemon's notion of time and timezones. # # Output of the crontab jobs (including errors) is sent through # email to the user the crontab file...