Simple for those who know.

Hi,
In Php I can use exec() to access the shell from my .php web page. Tested and it works.

So, I need to create a cron job that visits my URL at the time contained in my $time php variable. That's it, just one visit to the specific URL.

Once the visit takes place, delete the cron job using exec(whatever command is needed to delete the cron job).

I know nothing about Linux commands to create cron jobs. I do know that I can use exec( Linux command to create said cron job and or delete cron job) in php.

Can someone please fill in the () to accomplish this?

It's a php web page that will run for 24 hours about three times a month. No consistency to the times or monthly pattern. Thus the need for self contained create/delete cron job.

Site is very low traffic and the cron visit is needed to trigger an email function at the specified time.

Thanks very much for any assistance!

The normal way to add and remove cron jobs for a user is by using crontab -e which, by default, uses vi (which is an interactive editor). You could use a command like:

EDITOR=ed crontab -e <<-EOF
place editing command(s) here
EOF

but with no indication of what the cron job to be deleted looks like and what other cron jobs this user might also have in their crontab job list, it is impossible to suggested what editing command(s) might be needed to solve your specific problem.

Thanks Don.
There won't be any other cron jobs and I am the only user.

In that case, the editing commands:

1d
w
q

should be sufficient.

For a one-off execution of some command, did you consider the at command?