I found the following on stackoverflow but was wondering how to change this so I can append and delete a specific cron job. Also was wondering how this would interplay with cron jobs set up through Cpanel on a shared host?
$cron_file = 'cron_filename';
// Create the file
touch($cron_file);
// Make it writable
chmod($cron_file, 0777);
// Save the cron
file_put_contents($cron_file, '* * * * * your_command');
// Install the cron
exec('crontab cron_file');