-
Notifications
You must be signed in to change notification settings - Fork 480
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Could termux-job-scheduler schedule jobs at a particular time (like cron) #282
Comments
Hey, Meanwhile, if you want to schedule a job to run at a specified time, a quick and dirty hack could be
and then use Edited to add: several months ago I've actually had a good experience using the real |
Hi! I remember reading this issue when it was fresh, and with the hit-and-miss nature of cron on Android, I too looked for something other than 'Tasker' for automation (I think that integration with a FOSS automation app like 'Easer' would be much better, I and some others dont use closed-source, I run Android google-less etc), anyways... I found an amazing app! one that could kick-start this issue! I totally forgot to share it here earlier, its open-source, available from Github/F-Droid, and it uses crond - Github THANK YOU FOR ALL YOU DO, IT IS TRULY APPRECIATED! |
Hi, EDIT: There are now a couple of PRs open to implement this: #657 I have some more or less working CronAPI implementation locally. It is currently still missing to "re-add all alarms after reboot" and I have tested it until now only with an emulator. It also still needs a bit of cleaning up. Here is the general flow: Scheduling is done via AlarmManager. Jobs are not scheduled "periodically" but once a job finishes the next execution is scheduled. This allows to better handle more complex cron expression but has the drawback(?) that only a single "instance" of the script is executed at a time. Once a job's start time is reached, a WorkRequest via WorkManager is created. This is the place where the constraints are evaluated. Meaning: "Work" is created at the scheduled time, but execution will wait until constraints are met. Here is it is possible to cancel the WorkRequest if it takes too long to fulfill the constraints. When the worker request is executed, it will trigger termux and run the script. The worker thread will wait until termux finishes, or until a maximum runtime. If that is reached the worker thread will try to kill the termux script. Another issue is that I (at least for the moment) raised the Sorry for the long wall of text, and thank you if you read it all ;) |
Hi there,
firstly, thanks for taking the time to maintain this.
I was wondering whether
termux-job-scheduler
could schedule cron-like jobs at a particular time?Thank you
The text was updated successfully, but these errors were encountered: