H
H
Horosh2942021-08-27 21:57:08
Android
Horosh294, 2021-08-27 21:57:08

How to make cron job for android smartphone?

In general, I have a php script that I would like to execute from my smartphone every minute. This script, of course, sends get requests to the Internet.
The question is quite simple, how to make this php script run?
Perhaps there are already ready-made solutions or something similar.
You don’t have to write about renting a server or hosting, this solution will not work, let’s take it as a fact.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
Z
Zettabyte, 2021-08-28
@Horosh294

cron job for android smartphone

I think you'll need root (although crond itself should run as normal) and busybox.
Create a folder for the "root" file, which will contain the tasks, for example, /data/cron/. In it, create a "root" file. Add a task to it (run komanda every 13th minute of the hour):
echo ' 
13 * * * * komanda' >> /data/cron/root

Launch:
su -
crond -b -c /data/cron

Crond should appear in services. When editing a task, you need to crash the service and restart it again.
A more detailed article (about autorun, etc.): https://habr.com/ru/post/468337/
I have a php script that I would like to execute from my smartphone every minute

But in any case, in my opinion, the idea looks rather strange. I don’t know how it will be possible to combine PHP and the phone - it’s up to you to figure it out.
If you do not need incoming connections (only get), then it will be much easier and hassle-free to buy the cheapest IPv6-only VPS with a minimum of memory. It will cost a few dollars a year (a year!), and will provide much more convenience and opportunities.

D
Developer, 2021-08-28
@samodum

To execute the script on the server, you need to periodically pull it. Here are the options:
Start a background service.
work manager.
looper.
Make Widget
...

A
alex1478, 2021-08-28
@alex1478

Use termux or equivalent. This is almost a complete linux environment. Then use and configure it as a virtual server.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question