-
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 daemonatdto 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.phpThe 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?
-
@girish you're a genius man! I think it should work, I'll try it and come back. Thanks!!
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login