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?
- Go to “Schedules” in sidebar
- Click “New Schedule”
- Configure the schedule
- 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 -yOr multi-line scripts:
#!/bin/bash
# Pull latest code and restart the application
cd /app
git pull
npm install
pm2 restart allHow 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:
- Click a schedule
- Go to “History” tab
- 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?
- Click schedule
- Modify settings
- Save changes
How do I temporarily disable a schedule?
Temporarily disable:
- Toggle “Enabled” off
- Schedule won’t run until re-enabled
How do I delete a schedule?
Remove schedule:
- Click “Delete”
- Confirm deletion
- History is also deleted
How do I manually run a schedule now?
Manually trigger:
- Click “Run Now”
- Execution starts immediately
- 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 buildLast updated on