Scheduled Tasks
Schedule commands to run automatically.
Create Schedule
- Go to “Schedules” in sidebar
- Click “New Schedule”
- Configure the schedule
- Save
Schedule Configuration
Basic Info
- Name - Descriptive name
- Description - What this schedule does
- Enabled - Toggle on/off
Command
Enter the command to execute:
apt update && apt upgrade -yOr multi-line scripts:
#!/bin/bash
cd /app
git pull
npm install
pm2 restart allTarget Machine
Select which machine(s) to run on:
- Single machine
- Multiple machines
- Tag-based selection
Timing
Cron Expression
Use cron syntax:
# Every day at 3 AM
0 3 * * *
# Every Monday at 9 AM
0 9 * * 1
# Every hour
0 * * * *Preset Schedules
Quick options:
- Every hour
- Every day
- Every week
- Every month
One-time
Run once at a specific time:
- Pick date and time
- Timezone selection
Notifications
Get notified:
- On completion
- On failure only
- Never
Schedule List
View all schedules with:
- Name and description
- Next run time
- Last run status
- Quick actions
Filter
Filter by:
- Status (enabled/disabled)
- Machine
- Last run status
Schedule 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)
Manage Schedules
Edit
- Click schedule
- Modify settings
- Save changes
Disable
Temporarily disable:
- Toggle “Enabled” off
- Schedule won’t run until re-enabled
Delete
Remove schedule:
- Click “Delete”
- Confirm deletion
- History is also deleted
Run Now
Manually trigger:
- Click “Run Now”
- Execution starts immediately
- Results appear in history
Best Practices
Naming
Use descriptive names:
- ✅ “Daily backup - production database”
- ❌ “Schedule 1”
Error Handling
Include error handling:
#!/bin/bash
set -e # Exit on error
# Your commands here
npm run build || echo "Build failed"Logging
Log output for debugging:
#!/bin/bash
exec >> /var/log/schedule.log 2>&1
echo "$(date): Starting backup"
# ... commands
echo "$(date): Backup complete"Timeouts
Set appropriate timeouts:
- Default: 5 minutes
- Long tasks: up to 1 hour
Dependencies
Check dependencies:
#!/bin/bash
if ! command -v npm &> /dev/null; then
echo "npm not installed"
exit 1
fi
npm run build