How to run one-time cron jobs

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'd like to process one item at a time, instead of creating a one-time cronjob with the item data, you should store those items (with their scheduled times if necessary) in your database, and set a cronjob every few seconds or minutes to retrieve and process those items.
  • If you'd like to process a multistep cronjob, instead of creating a one-time cronjob with the next step data, you should redirect to the new URL. FastCron will follow the HTTP redirection.

If you still need to create/run one-time cronjobs, follow the instructions below.

Create one-time cronjobs manually

  • Click new Cron Job
  • Enter the URL to your cron script.
  • Click the clock button next to Interval
  • Enter the time into the Expression field, e.g. Feb 14, 2030, 7:30
  • Click Save changes.

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.

Run one-time cronjobs using API

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.

Ready for better cronjobs?

See why 8,000+ website developers and their teams use FastCron to run their cronjobs 12 million times a day.

Start 14-day free trial

FastCron

The reliable online cronjob service for your websites since 2009.


© 2009 - 2026 FastCron · All rights reserved · Terms of service · Privacy policy · Website monitored by Cahook · Status