Overview
Thecron command manages scheduled tasks that run automatically at specified intervals or cron expressions. Tasks can send messages to the agent and optionally deliver responses to messaging channels.
Usage
picoclaw c
Subcommands
list
List all scheduled jobs (enabled and disabled).add
Add a new scheduled job.Flags
Job name for identification.
Message to send to the agent when the job runs.
Run every N seconds. Mutually exclusive with
--cron.Cron expression for scheduling. Mutually exclusive with
--every.Deliver the agent’s response to a channel.
Channel to deliver response to (requires
--deliver).Available channels: telegram, slack, discord, whatsapp, etc.Recipient identifier for delivery (channel-specific: chat ID, user ID, channel name).
--every or --cron must be specified, but not both.
remove
Remove a job by its ID.enable
Enable a disabled job.disable
Disable an active job (keeps configuration but prevents execution).Examples
Simple Periodic Task
Run every 5 minutes (300 seconds):Daily Report with Delivery
Generate and send a daily report to Telegram:Hourly Monitoring
Check system health every hour:Weekly Backup Reminder
Remind about backups every Monday at 10 AM:Every 30 Seconds
Rapid monitoring:List All Jobs
Temporarily Disable a Job
Remove Completed Job
Cron Expression Format
When using--cron, use standard cron syntax:
Common Patterns
Job Storage
Jobs are stored in:~/.picoclaw/workspace/cron/jobs.json
This file is automatically managed by the cron service. You can back it up or version control it.
Execution
Cron jobs only execute when the gateway is running:- Execute at scheduled times
- Send messages to the agent
- Receive agent responses
- Optionally deliver to channels
- Log execution results
Timeouts
Job execution timeout is configured inconfig.yaml:
Delivery Channels
When using--deliver, specify:
Telegram
Slack
Discord
Other Channels
Refer to channel-specific documentation for recipient format.Tips
- Testing: Use short intervals (e.g.,
-e 60) for testing, then adjust - Timezone: Cron expressions use the system timezone
- Job Names: Use descriptive names for easy identification
- Delivery: Test delivery without cron first using
picoclaw agent - Monitoring: Check logs when gateway runs to see job execution
- Disable vs Remove: Use disable to temporarily pause jobs; remove to delete permanently
Common Use Cases
-
System Monitoring: Regular health checks
-
Daily Reports: Automated summaries
-
Alert Checking: Periodic alert monitoring
-
Backup Verification: Weekly backup checks
Troubleshooting
Jobs Not Running
Problem: Jobs listed but not executing Solution: Ensure gateway is running:Invalid Cron Expression
Error:Delivery Failures
Problem: Job runs but delivery fails Solution:- Verify channel is configured and enabled in config
- Check recipient identifier is correct
- Test delivery manually with
picoclaw agent
Exit Codes
0: Success1: Error (invalid arguments, job not found, etc.)
See Also
- picoclaw gateway - Required for job execution
- picoclaw agent - Test messages before scheduling
- Channel Configuration - Configure delivery channels