CronTool
Cron expression editor & debugger
Question

I am looking to have a script run every 5 minutes, beginning at 13:02, and another script to run every 5 minutes starting at 13:04, so the second script runs two minutes after the start of the first job. How can I accomplish this?

Answer

In this case, you will need two cron jobs:


2-59/5 * * * * command

4-59/5 * * * * command


This will result in the first command running every 5 minutes, starting with an offset of 2 minutes at the beginning of each hour, and the second command behaving similarly with an offset of 4 minutes.

Why this matters

Cron has no concept of “run B after A finishes”. It's a time-based scheduler, not a workflow engine. The closest you can get is: schedule both jobs on the same fixed-interval cadence, with a phase offset that's big enough to assume A is done before B starts.


The 2-minute offset above assumes the first job's usual runtime is well under 2 minutes. If A occasionally takes 5+ minutes, B will start while A is still running — and you're back where you started. For proper dependency ordering you need a wrapper script (lock file + flock), a queue (Redis, RabbitMQ), or a workflow tool (Airflow, Temporal, Argo).


If you only care that B runs after A's schedule fires, you can combine them in a single shell command on a single cron line: 2-59/5 * * * * (commandA && commandB). The && only runs B if A succeeded; ; runs B regardless.

Read the dedicated guide: Cron every 5 minutes.

Cron schedules used

See this cron expression on the calendar → view example

Related cron questions

Other answers and worked examples for the most confusing cron expressions.

QuestionHow do I set a cron script for every 5 minutes without using the minutes divisible by 5?
QuestionI want to execute a task every 20 minutes, starting at 5 past the hour, is it possible to achieve this with Cron?
QuestionCan I set up a cron job to run every 15 minutes throughout the day, except for 3:00 AM? I have another task that I want to run at 3:00 AM and don't want these two conflicting.
QuestionI am trying to create a Cron expression that runs every day at 8:00 AM and 3:30 PM. I understand how to create an expression that runs once a day, but not at multiple set times.

Ready to schedule it?

Point Crontap at any URL. Pick any cron. Done.

WordPress, Shopify, Railway, Cloud Run, Vercel, HubSpot, Ghost, your own box. If it answers HTTP, Crontap can drive it on a clock you can read, in the timezone that actually matters, and page you when something breaks.

Free forever tier ・ No credit card required

Your next schedule
GET/wp-cron.php?doing_wp_cron=1

Schedule

every 5 minutes

Next run

in 23s

Permalink: https://tool.crontap.com/help/cron-job-run-script-after-another-one-finishes

Apihustle Logo

This tool is part of the Apihustle suite - a collection of tools to test, improve and get to know your API inside and out.

  • Clobbr logo

    Clobbr

    The app & CLI tool to test API endpoint speed.

    Visit
  • Crontap logo

    Crontap

    Schedule recurring API calls using cron syntax.

    Visit
  • CronTool logo

    CronTool

    Debug multiple cron expressions on a calendar.

    Visit

  • Page AI

    AI Website Generator that designs and writes clean code.

    Visit
  • Shipixen

    Generate customized boilerplates in minutes.

    Visit
  • Page UI

    Landing page UI components for React & Next.js

    Visit