I am creating dynamic cronjob using php script. cron job adding function is working fine for me. My script is given below.
<?
$output = shell_exec('crontab -l');
file_put_contents('/tmp/crontab.txt', $output.'* * * * * NEW_CRON'.PHP_EOL);
echo exec('crontab /tmp/crontab.txt');
?>
I need to edit separate cronjob using php. i am trying many ways but its not working. my edit cron Script isgiven below
-e (edit user's crontab)
<?
$output = shell_exec('crontab -l');
file_put_contents('/tmp/crontab.txt', $output.'* * * * * NEW_CRON'.PHP_EOL);
echo exec('-e crontab /tmp/crontab.txt');
?>
My ref link LINK
How can i edit cron job using php. Please advise