Documentation
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:
-
Select your Servd project
-
Click the environment in the sidebar you'd like to add a scheduled command to (e.g. Production, Staging, etc).
-
Click the "Commands" sub-navigation option.
-
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".
-
Click the "Add button"
-
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.