For example I have a cron running on the 1st of every month, this cron executes a PHP script that returns some dates.
I want to use these dates and modify the schedule of another cron job?
I know I can add a new cronjob doing something like this but unsure of how to update 1 specific entry when there could be multiple.
$output = shell_exec('crontab -l');
file_put_contents('/tmp/crontab.txt', $output.'* * * * * NEW_CRON'.PHP_EOL);
echo exec('crontab /tmp/crontab.txt');