Skip to main content

Run Custom Commands on a Schedule

Custom command jobs let you run arbitrary shell commands in an agent container on a recurring schedule. This is useful for maintenance scripts, data pipelines, or any task that can be expressed as a shell command.

Prerequisites

  • You are signed in to the XpressAI Platform.
  • You have a deployed agent whose container will execute the command.

Steps

  1. Navigate to the Schedules section from the sidebar.
  2. Click Create Schedule.
  3. Enter a name for the schedule.
  4. Select Custom Command as the job type.
  5. Enter the shell command you want to run in the Command field.
  6. Set the cron expression and timezone.
  7. Click Save.

Command execution environment

  • Commands run inside the agent container.
  • The working directory is /data/home/, which is the agent's mounted NFS volume.
  • Standard shell expansion is available (environment variables, globbing, pipes).
tip

You can chain multiple commands using && or ; in a single command field. For example: cd /data/home/scripts && python run_report.py

warning

Commands run with the permissions of the agent container. Make sure your command does not require privileges beyond what the container provides.

Verify

  • The schedule appears in the Schedules list with the job type shown as Custom Command.
  • After the scheduled time, check the execution history to confirm the command ran.
  • Review the execution logs and exit code to verify the command completed successfully.