Using cron to create a schedule for your loopΒΆ

You should use cron to create a schedule for your loop. Use oref0 cron-5-minute-helper to generate a simple cron job. It can be imported into crontab using oref0 cron-5-minute-helper do-loop | crontab -. By default, it will list a suggested cron job that runs once every 5 minutes.

Here’s an example:

$ oref0 cron-5-minute-helper openaps do-foo-bar

*/5 * * * * (cd /home/bewest/src/openaps/docs && time openaps do-foo-bar) 2>&1 | logger -t openaps-loop

It prepares a cron template to change to the current directory and runs whatever was specified, sending all output to syslog.