Skip to Content

Scheduled Tasks

TL;DR

Cmdop scheduled tasks let you automate recurring commands on remote machines. Create schedules using cron expressions or preset intervals, target single or multiple machines by tags, monitor execution history with output logs, and configure notifications for completion or failure events.

Schedule commands to run automatically.

How do I create a scheduled task?

  1. Go to “Schedules” in sidebar
  2. Click “New Schedule”
  3. Configure the schedule
  4. Save

How do I configure a schedule?

What basic information do I set?

  • Name - Descriptive name
  • Description - What this schedule does
  • Enabled - Toggle on/off

How do I specify the command?

Enter the command to execute:

# Update system packages apt update && apt upgrade -y

Or multi-line scripts:

#!/bin/bash # Pull latest code and restart the application cd /app git pull npm install pm2 restart all

How do I select the target machine?

Select which machine(s) to run on:

  • Single machine
  • Multiple machines
  • Tag-based selection

How do I set the timing?

How do I use cron expressions?

Use cron syntax:

# Every day at 3 AM 0 3 * * * # Every Monday at 9 AM 0 9 * * 1 # Every hour 0 * * * *

What preset schedules are available?

Quick options:

  • Every hour
  • Every day
  • Every week
  • Every month

How do I schedule a one-time execution?

Run once at a specific time:

  • Pick date and time
  • Timezone selection

How do I configure notifications?

Get notified:

  • On completion
  • On failure only
  • Never

What does the schedule list show?

View all schedules with:

  • Name and description
  • Next run time
  • Last run status
  • Quick actions

How do I filter schedules?

Filter by:

  • Status (enabled/disabled)
  • Machine
  • Last run status

How do I view schedule execution history?

View execution history:

  1. Click a schedule
  2. Go to “History” tab
  3. See all past runs

Each run shows:

  • Timestamp
  • Duration
  • Exit code
  • Output (stdout/stderr)

How do I manage existing schedules?

How do I edit a schedule?

  1. Click schedule
  2. Modify settings
  3. Save changes

How do I temporarily disable a schedule?

Temporarily disable:

  1. Toggle “Enabled” off
  2. Schedule won’t run until re-enabled

How do I delete a schedule?

Remove schedule:

  1. Click “Delete”
  2. Confirm deletion
  3. History is also deleted

How do I manually run a schedule now?

Manually trigger:

  1. Click “Run Now”
  2. Execution starts immediately
  3. Results appear in history

What are the best practices for scheduled tasks?

How should I name my schedules?

Use descriptive names:

  • âś… “Daily backup - production database”
  • ❌ “Schedule 1”

How should I handle errors in scheduled scripts?

Include error handling:

#!/bin/bash set -e # Exit on error # Attempt build; log failure message if it fails npm run build || echo "Build failed"

How should I log output from scheduled tasks?

Log output for debugging:

#!/bin/bash # Redirect all output to a log file for later review exec >> /var/log/schedule.log 2>&1 echo "$(date): Starting backup" # ... commands echo "$(date): Backup complete"

How should I set timeouts?

Set appropriate timeouts:

  • Default: 5 minutes
  • Long tasks: up to 1 hour

How should I check dependencies before running?

Check dependencies:

#!/bin/bash # Verify npm is installed before attempting a build if ! command -v npm &> /dev/null; then echo "npm not installed" exit 1 fi npm run build
Last updated on