VR-25 / djs

Daily Job Scheduler
https://github.com/Magisk-Modules-Repo/djs
GNU General Public License v3.0
82 stars 12 forks source link

Execute script every X minute. #17

Closed docccccc closed 2 years ago

docccccc commented 2 years ago

Hi, Thanks for this awesome module. Is it possible to add the ability to execute scripts every certain time?

For example, I want to execute script every 1 minute. And so, I have to add 1440 lines to config.txt. A little big :)

VR-25 commented 2 years ago

Although not as flexible as crontab's syntax, one can do a lot with DJS' seemingly too basic rules.

To run a script every minute, a loop can be used. Remember that a shell script has high flexibility.

boot while true; do run_script; sleep 60; done

Of course, instead of boot, a time can be used as starting point instead.

Using both (e.g., for fail safe runs) also works:

0700 while :; do run_script; sleep 60; done; : --boot

docccccc commented 2 years ago

Great! Its working. :) Thanks.