Skip to content
SceneCMS

Scheduled tasks (cron)

The one cron line an installation needs, what it runs, and what breaks without it.

One line, once a minute

Laravel keeps its own timetable in routes/console.php; the server only has to poke it. Add a single cron entry for the user that runs PHP:

* * * * * cd /var/www/tickets && php artisan schedule:run >> /dev/null 2>&1

Install it for the web server user, not for root, so the files it writes keep the right owner:

sudo -u www-data crontab -e

On Debian and Ubuntu you can instead drop a file into /etc/cron.d, which states the user explicitly:

# /etc/cron.d/scenecms
* * * * * www-data cd /var/www/tickets && /usr/bin/php artisan schedule:run >> /var/log/scenecms-schedule.log 2>&1

schedule:run exits immediately when nothing is due, so running it every minute costs almost nothing.

What it runs

When Command What it does
Every minute scene:carts:prune Releases seat holds from abandoned checkouts
03:00 daily backup:run Takes the nightly backup archive
03:40 daily backup:clean Deletes archives past the retention window
Monday 03:10 scene:license:check Re-validates the licence, silently, offline-tolerant

Times are in the application timezone (config/app.php, timezone).

Checking it

php artisan schedule:list

prints every task with its cron expression and the next due time — the fastest way to confirm the timetable is what you expect after an update.

To run one task right now, without waiting for its slot:

php artisan schedule:test

and pick it from the list. The output goes to the same place the cron job writes.

What breaks without cron

The site keeps selling tickets — nothing about the storefront depends on the scheduler. What degrades is the quiet work around it:

  • Seats stay held. A customer who closes the checkout leaves the seats in a pending cart. Without the minute-by-minute prune they stay unavailable until someone clears the holds by hand, and a popular row looks sold out while it is not.
  • No backups. backup:run is a scheduled command; without cron there are no nightly archives, and an update that needs to roll back has nothing to roll back to. The manual Admin → Backups → Create backup button still works and is worth using before a risky change.
  • No licence re-check. The weekly call to the licence server never happens. Signatures are verified offline, so the installation keeps working; the admin panel just stops knowing whether support is still current.

Queue

Keep QUEUE_CONNECTION=sync (the default) unless you run a worker yourself:

php artisan queue:work

A database queue with no worker accepts jobs and silently never delivers them. The product sends its own mail and runs its own jobs during the request, so a worker is only needed if you add queue-based code of your own.

Not covered here?

Write to sales@scenecms.com — we answer within one business day.

Contact