The best use case for one-time cronjobs (cronjobs that run once at a specific time) is scheduling a task once at a specific time and it won't recur ever again. For example, I schedule an email blast to notify new IP addresses before they're in use.
For other use cases, there are some better ways:
If you still need to create/run one-time cronjobs, follow the instructions below.
And that's it. You can click on the cron job name to show the Logs page, and confirm that the next run time is correct.
FastCron will automatically delete stopped one-time cronjobs 3 days after their last executions.
You don't need to delete it manually or using cron_delete.
To programmatically run one-time cronjobs, you can create a cronjob (with Interval: Manual),
then schedule to run it at a specific time using
cron_run.
curl -X POST "https://www.fastcron.com/api/v1/cron_run" \
-H 'Content-Type: application/json' \
-d '{
"token": "YOUR_API_TOKEN",
"id": CRONJOB_ID,
"time": 1905821065
}'
The command above will run your cronjob at Friday, May 24, 2030 2:44:25.
You can also attach a payload to the execution time like this:
curl -X POST "https://www.fastcron.com/api/v1/cron_run" \
-H 'Content-Type: application/json' \
-d '{
"token": "YOUR_API_TOKEN",
"id": CRONJOB_ID,
"time": 1905821065,
"payload": "test=value&name=value2"
}'
The command above will run your cronjob at Friday, May 24, 2030 2:44:25 with the payload test=value&name=value2.
Need help? Reach out to support@fastcron.com - we're happy to help.
See why 8,000+ website developers and their teams use FastCron to run their cronjobs 12 million times a day.
The reliable online cronjob service for your websites since 2009.