Support at command in LAMP app
Is it possible to enable the
atcommand using a LAMP app?
I installed it using
apt-getin a custom LAMP app, but I cannot enable it or use it. My goal is to schedule a task (run a script) at the indicated time (timestamps are downloaded from a server and may vary from day to day).
@alex-adestech Looks like the
atcommand will require a daemon
atdto run. Would it be possible to workaround using cron instead? The lamp app has built-in cron support using which you can schedule at any specific time - https://cloudron.io/documentation/apps/lamp/#cron-support
@girish Well, the thing is that I download a JSON Object with some timestamps indicating the next time the server needs to run a specific script. These timestamps are different each day.
For example, Monday the 1st should run at 3pm and 5 pm, but next Monday should run at 1pm and 9 pm.
Could it be possible to edit the crontab file using a script?
The lamp app needs to restart after cron has changed right?
Maybe that could be a workaround.
@alex-adestech Ah, I see. The usual workaround for this is to put a command in crontab like so:
0 * * * * php /app/data/periodic.php
The above runs every hour. Then in
periodic.php, you can check the current time or some file to see what tasks you want to run etc.
Would that work?