Scheduled jobs on a VPS: cron and queues
Almost every project has work that runs without a user: a nightly export, a mailing, cleaning up old data, processing uploaded files. Here is when cron is enough, when you need a queue and what to set up so jobs are neither lost nor run twice.
The short answer. Run what must happen at a set time through cron or a systemd timer. Put what a user action triggers and what should not delay the response (an email, a report, file processing) into a queue, processed by a separate worker process. For a small project both run on the same VPS.
Cron: what to know
A crontab line is five time fields and a command, so cron never runs anything more often than once a minute. Per crontab(5), the command runs through /bin/sh with a minimal environment and none of your shell settings: write full paths to the interpreter and the script and cd into the project folder. Cron mails command output to the MAILTO address; on a server without mail, redirect it to a log file, or nobody will see the errors. Times follow the server's time zone — check it before scheduling nightly jobs.
Double runs and missed runs
If a job takes longer than its interval, cron starts a second copy on top of the first: two exports write to one table, a mailing goes out twice. The simple fix is to wrap the command in flock -n with a lock file: the second copy just does not start. The other problem is missed runs: if the server was off at the scheduled time, cron does not repeat the job. Systemd timers have Persistent=true for this — a missed run starts right after boot — and RandomizedDelaySec spreads jobs out so they do not all start at 00:00. The timer log goes to journald with everything else, see Server logs.
Framework schedulers
In Laravel the schedule is defined in code and crontab gets a single line — schedule:run every minute. By default a task starts even if the previous run is still going; withoutOverlapping turns on protection. On several servers a task runs on each of them unless you add onOneServer. Celery beat in Python has the same rule: there must be only one scheduler, or tasks are duplicated.
Queues and workers
The queue lives in Redis or in the database, and a worker is a long-running process that takes jobs one by one. It keeps the code in memory and does not see changes, so workers are restarted after each deploy (queue:restart in Laravel), and Supervisor or systemd watches the worker and brings it back after a crash. If the queue is in Redis, turn on AOF persistence: with the default setting you lose at most a second of writes rather than every job after a reboot. Selection: VPS for Redis.
When you need a separate server
Workers move to a second VPS when heavy jobs (video, reports, scraping) slow the website down. In the accsly.io catalog on 18 November 2026 there are 1,644 plans with 1 vCPU and 2 GB at 957 hosts; the monthly median with monthly billing and no prepayment is €9.70 for plans priced in euros, $13 in dollars and 770 ₽ in roubles. If the heavy work runs once a day, you can start a server just for the job: 172 of 2,161 hosts list hourly billing, see Hourly billing. Selections: VPS for Laravel and VPS for Python.