I want to create a cron job which will run with the user define time in database. For eg.User can set start time and end time in the database .When the end time is reached I want cron to trigger one script to send mail.First of all Is it possible in cron or I have to go with some different approach ? and this all things will be done on AWS EBS. Below is what I tried on my local machine to just send a simple mail which is too basic
*/1 * * * * /usr/bin/php -q/var/www/html/cronTry/cron.php
You dont want to run the CRON every minute instead create a specific job for your user and run it once. Something like this should work (untested - on mobile)
This will append a job to the crontab at the time your user has defined
Get the dynamic details from the database, create the command string and
You can easily run your cron by passing the command in the shell_exec()