Cron job hosting
Run cron jobs in the cloud without keeping a server
To run cron jobs in the cloud without keeping a server, deploy the job as a cron service: Makofy runs your command on a standard 5-field schedule (for example 0 3 * * *), never starts a run while the previous one is still going, and retries a failed run up to two times. A cron service costs $3.50 a month on the Starter type, however often it runs.
Last updated · By the Makofy team (Muncar Ventures LLC)
How Makofy runs a scheduled job
A cron service is your code plus a schedule. At each scheduled time Makofy starts a fresh container from your latest build, runs the service’s start command (or the image’s default command), and stops it when the command exits. Nothing runs between executions, and there is no machine for you to patch, reboot or keep an eye on.
| Behaviour | What happens |
|---|---|
| Schedule format | Standard 5-field cron: minute, hour, day of month, month, day of week |
| What runs | The start command you set (run with sh -lc), or the image’s CMD |
| Overlapping runs | Never: if a run is still going at the next scheduled time, the new run is skipped |
| Time limit | Each run may take up to 1 hour |
| Failures | A run that exits with an error is retried up to 2 times |
| History | The last 3 successful and the last 3 failed runs are kept |
| Configuration | Environment variables and env groups, like any other app |
| Price | Billed as an app: Starter $3.50/mo or larger (Nap is for web services only) |
Deploy a scheduled job step by step
- Write the job as a script that does its work and exits: status 0 on success, non-zero on failure.
- Install the CLI with
curl -fsSL https://makofy.com/install.sh | shand runmakofy login. - From the project folder, run
makofy deploy --type cron --schedule "0 3 * * *" --command "python job.py". The CLI uploads and builds the project, creates the schedule and prints “Cron job scheduled”. - Add the variables the job needs, such as
DATABASE_URL, in the dashboard, then deploy again so the next runs pick them up. Variables are applied at deploy time. - To change the timing, run
makofy deployagain with a new--schedule. The folder stays linked to the same app through a.makofy.jsonfile. - Or connect a GitHub repository in the dashboard, so every push to your branch rebuilds the job’s code.
# job.py: delete sessions older than 30 days, then exit
import os
import sys
import psycopg # requirements.txt: psycopg[binary]
try:
with psycopg.connect(os.environ["DATABASE_URL"]) as conn:
deleted = conn.execute(
"DELETE FROM sessions WHERE created_at < now() - interval '30 days'"
).rowcount
print(f"cleanup ok: {deleted} rows deleted")
except Exception as exc:
print(f"cleanup failed: {exc}", file=sys.stderr)
sys.exit(1) # non-zero exit: the run counts as failed and is retriedThe same works in any language Makofy builds. A Node.js job is --command "node jobs/cleanup.js", a Go job is a small binary, and a shell script that calls curl against your own API is a perfectly good cron job too. If the job needs tools that aren’t in the detected image, add a Dockerfile (see deploying Docker containers).
Cron schedule examples
| Schedule | Runs |
|---|---|
*/15 * * * * | Every 15 minutes |
0 * * * * | At the start of every hour |
0 3 * * * | Every day at 03:00 |
30 6 * * 1-5 | Weekdays at 06:30 |
0 9 * * 1 | Mondays at 09:00 |
0 0 1 * * | At midnight on the first day of each month |
Makofy cron vs other ways to schedule a job
| Option | Cost | Trade-offs |
|---|---|---|
| Makofy cron service | $3.50/mo per job (Starter) | Managed schedule, no overlapping runs, automatic retries; one region (Helsinki) |
| crontab on a VPS | The VPS, plus your time | You patch the OS, watch the disk and notice when the machine dies |
| A timer loop inside a web app | Nothing extra | Stops when the app sleeps or restarts, and runs twice if two copies of the app are running |
GitHub Actions schedule | Included minutes vary by plan | Can start late at busy times, and production secrets have to live in your CI |
| Your laptop’s crontab | Free | Only runs while the laptop is on and awake |
One cron service runs one command on one schedule. If you have several small jobs on the same schedule, a single script that runs them one after another costs one app; jobs on different schedules are separate cron services at $3.50 each. Work triggered by events rather than the clock (a signup, an upload) is a better fit for a background worker reading a queue.
What typical scheduled workloads cost
| Workload | What runs on Makofy | Monthly cost |
|---|---|---|
| Nightly cleanup of an app’s database | Starter cron + Postgres | $6.50 |
| Hourly data sync from a third-party API | Starter cron | $3.50 |
| Daily report e-mail plus weekly digest | 2 × Starter cron | $7 |
| Monthly invoices that need more memory | Basic cron (1 GB / 1 vCPU) | $6 |
Tips for jobs that run unattended
- Exit codes matter. Exit non-zero on failure so the run counts as failed and gets retried.
- Make jobs safe to repeat. A retry or a manual re-run shouldn’t send the same email twice; record what has been done in Postgres.
- Report failures where you’ll see them. Print a clear line at the start and end, and send failures to a Discord or Slack webhook, an error tracker or a table you check.
- Stay under an hour. A run is stopped after 1 hour, so split long work into batches and let each run pick up where the last one stopped.
- Pick the right size. Memory-hungry jobs such as reports or image processing can use Basic (1 GB) or Pro (2 GB); see instance types.
FAQ
Frequently asked questions
How much does a cron job cost on Makofy?
Each cron service is billed as an app: $3.50 a month on Starter, whether it runs every 15 minutes or once a month.
What cron syntax does Makofy use?
Standard 5-field cron (minute, hour, day of month, month, day of week), for example 0 3 * * * for 03:00 every day.
What happens if a job is still running at the next scheduled time?
The new run is skipped. Makofy never runs two copies of the same cron job at once.
Are failed cron runs retried?
Yes. A run that exits with a non-zero status is retried up to two times, and each run can take up to an hour.
Can a cron job use the $1.50 Nap type?
No. Nap is for web services only; cron jobs need Starter ($3.50) or a larger instance type.
Related
Deploy your app in a few minutes.
Connect a GitHub repo or run makofy deploy. Flat price per app, 7-day free trial, card required.