Cron Job - Replov Docs
Skip to main content

Cron jobs

Run a container command on a validated schedule and timezone.

A deployed cron service stays at zero replicas between runs. At each due occurrence, Replov starts one Docker Swarm task from the deployed image. The task is not automatically restarted after it exits, and a still-running task prevents an overlapping occurrence from starting.

Repository command, not a URL monitor
A Cron Job runs code from a repository. It does not send scheduled HTTP requests to a URL. Put the task in your repository, enter the one-off job command, and make sure the command exits when the work is complete.

Current behavior

Standard five-field cron expressions

IANA timezones such as Asia/Kolkata or UTC

A distributed per-minute lock across backend replicas

Next run, last run and total run values stored with the service

Build and runtime output available through service logs

Stopping the service disables future scheduled runs

One process per occurrence
Your start command should finish when the task is complete. Use a background worker instead for a process that must remain running continuously. Replov skips an occurrence when the preceding task is still active.

Billing

A cron job pays only for the time its runs take. Each finished run is charged at the compute tier's per-minute rate (on Nano, about ₹0.0045 a minute), rounded up to whole minutes with at least one minute per run. Nothing is charged between runs, and an occurrence that is skipped or never starts is free.

Schedule syntax

text
minute hour day-of-month month day-of-week
* * * * *
ExpressionMeaning
*/5 * * * *Every five minutes
0 * * * *Every hour
0 0 * * *Every day at midnight
0 9 * * 1-5Weekdays at 09:00

Set up a cron service

  1. Create a cron service from the dashboard and select the repository and compute plan.
  2. Set a start command that performs one job and exits with zero on success.
  3. Enter a five-field schedule and an IANA timezone.
  4. Deploy once to build and register the zero-replica Swarm service.
  5. Use the service logs and next-run value to verify scheduled execution.
cleanup.jsjavascript
async function run() {
console.log('Cleanup started', new Date().toISOString());
// Perform one bounded unit of work here.
console.log('Cleanup finished');
}
run().catch((error) => {
console.error(error);
process.exitCode = 1;
});