Scheduled Commands

Scheduling a bit of code to run at specific times is a common requirement of most projects. With VPS services, you would SSH into your server and configure "cron jobs".

Servd make this a bit easier by allowing you to add "Scheduled Commands" directly in the dashboard:

  1. Select your Servd project

  2. Click the environment in the sidebar you'd like to add a scheduled command to (e.g. Production, Staging, etc).

  3. Click the "Commands" sub-navigation option.

  4. Under the "Scheduled Craft CLI Commands" section, you should see all your active scheduled commands. To add a new one, input the command you'd like to run and the schedule pattern into the inputs under "Add a Command".

  5. Click the "Add button"

  6. When you're ready, sync your project to deploy the scheduled command to your environment.

Types of commands #

Servd offers two types of scheduled commands:

  • ./craft console commands.
  • wget commands to make a web request to a specified URL.

Note: with both types you don't need to specify ./craft or wget as part of your command body.

A few things to know #

  • The schedule pattern follows the widely-adopted crontab syntax.
  • Commands can run at most once per 5 minutes.
  • Scheduling times run against the UTC timezone.
  • The number of scheduled commands you can have active at one time depends on your plan.