How to create cron Jobs via php

Asked

Viewed 664 times

0

I’m developing a system where he sends programmed emails using PHP. Then you will have a managerial interface that the user will be able to choose in how many days you want to send the emails.

Now my question is, how can I create a cron through how many days the user typed in a form?

Any other suggestions I can make?

  • Since you are developing the system, if it is linux hosting, this is if it is web, since details are missing... One way to do this would be to schedule a cron task to run every x minutes, it will then access your file. php that runs the routine and then forward is programming: the script checks if there is something to be done and performs the shots, otherwise closes the execution, a Return; (closes everything), but depends on what it is it can consume a valuable processing of your server.

  • With Nodejs you can do it too, check this out: https://answall.com/questions/93788/como-crea-scheduler-task-sem-utili-cron-e-sem-utili-wordpress I’m not going to give an answer because it might not be what you’re looking for.

  • @Tiagoboeing I think he wants the user to be able to schedule an email sending via programming (a panel for example), I think something like this: https://github.com/MUlt1mate/cron-manager

  • Yes, by having cron run its script every x minutes, it would be enough for the script to see if there is something to be done, based on what the user has defined. It will take work, but otherwise he would have to make php communicate via ssh and schedule the cron task.

  • @Guilhermenascimento I want to create a panel even where the user would have all the control for scheduling. I’m also using Windows server.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.