-
Notifications
You must be signed in to change notification settings - Fork 424
termux-job-scheduler #42
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
Conversation
This comment has been minimized.
This comment has been minimized.
|
So this uses android's native scheduler rather than relying on a crond running in termux? What's the syntax for using this? If, for example I wanted ~/foo.sh executed hourly, how would that be set up? |
|
@theARE This should do it: Unlike cron, it won't guarantee to run exactly hourly. But it won't keep your phone awake, and it will let you specify other conditions like "only when the phone is charging and the network is available".
See Android docs. |
|
Cheers, I will have a play Just discovered termux yesterday & loving it Been so frustrated installing propriety tasks to perform simple jobs when there's a perfectly good linux subsystem just sitting there Why did it take me so long to find this? Doh! |
|
Ah, shame Hopefully it'll shoe up in the next release |
|
Nice work! This is now available in version Note that this requires version 0.29 of the Termux:API app, which should be available on Google Play in a couple of hours and on F-Droid within a day or so. |
|
Cheers, upgrade pulled it in & I'm running it now One small correction, the example I was given, along with the "Usage" section of the script states that the interval param is --period_ms Just a typo in the usage section I'm sure, but thought it worth reporting, just in case it trips anyone else up Will report back with any other feedback |
|
Hi, how can I make the job stop? |
|
@juanspeed good question! The jobs aren't persisted so rebooting should do it (after removing any Termux::boot scripts you might have set up). You can also submit a new job with same job_id to change the timeout or the script, without rebooting. I should make a new PR to fix the doc bugs noted by @theARE, and expose the cancel method too. |
1 similar comment
|
@juanspeed good question! The jobs aren't persisted so rebooting should do it (after removing any Termux::boot scripts you might have set up). You can also submit a new job with same job_id to change the timeout or the script, without rebooting. I should make a new PR to fix the doc bugs noted by @theARE, and expose the cancel method too. |
|
@benmoran I did a new job to overwrite the job_id. I did not know about the restart, I'll try. Apparently there are ways to cancel the jobs it would be nice to be added in future updates :) |
|
I'm able to run this But when doing Any idea how to fix this? Many thanks. |
|
@n0ego file in /sdcard cant be executed. Either move it to somewhere in $HOME or make a wrapper script that runs |
|
It works now. Thank @Grimler91. Is there any way to list jobs and a script file associated with each job? Also can we specify starting time for a job? |
|
Wrapper script as requested in termux/termux-api#235 (comment)