Cron jobs allow you to run scheduled tasks at specified times or intervals.While you can run your own custom tasks, Laravel provides a scheduler to simplify the implementation.
To implement it, see the Laravel Task Scheduling documentation.
To run a command in a cron hook for specific environment types,
use the PLATFORM_ENVIRONMENT_TYPE environment variable:
.upsun/config.yaml
applications: myapp: [...] crons: snapshot: spec: 0 5 * * * commands: start: | # only run for the production environment, aka main branch if [ "$PLATFORM_ENVIRONMENT_TYPE" = "production" ]; then php artisan schedule:run >> /dev/null 2>&1 fi
Cron job execution on the default Upsun Cloud offering are limited to once every 5 minutes.
For more information, see the documentation on crons.However, you can add a worker
and specify a start command that runs the scheduler every minute.
To do so, use the following configuration:
Warning
Web and worker containers don’t share mount targets.
You can’t share files between those containers using the filesystem.
To share data between containers, use services.
Last modified on September 16, 2026
Was this page helpful?
Assistant
Responses are generated using AI and may contain mistakes.