| name | cron-scheduler |
| description | Manage scheduled tasks and automation on your system using cron. |
Cron Scheduler
Manage scheduled tasks and automation on your system using cron.
Category: automation, productivity
API Key Required: No
What It Does
Create, manage, and monitor scheduled tasks (cron jobs) on your machine. Automate backups, health checks, cleanup scripts, API calls, notifications — anything that should run on a schedule. Your agent handles the cron syntax so you don't have to.
Agent Commands
List all cron jobs
echo "=== User crontab ==="
crontab -l 2>/dev/null || echo "(empty)"
echo ""
echo "=== System cron ==="
ls /etc/cron.d/ 2>/dev/null
echo ""
echo "=== Cron directories ==="
echo "Hourly: $(ls /etc/cron.hourly/ 2>/dev/null | wc -l) jobs"
echo "Daily: $(ls /etc/cron.daily/ 2>/dev/null | wc -l) jobs"
echo "Weekly: $(ls /etc/cron.weekly/ 2>/dev/null | wc -l) jobs"
echo "Monthly: $(ls /etc/cron.monthly/ 2>/dev/null | wc -l) jobs"
Add a cron job
(crontab -l 2>/dev/null; echo "SCHEDULE COMMAND") | crontab -
Remove a cron job
crontab -e
crontab -l | grep -v "PATTERN_TO_REMOVE" | crontab -
Check cron logs
grep CRON /var/log/syslog | tail -20
journalctl -u cron --since "1 hour ago" --no-pager | tail -20
Test a cron command
COMMAND_HERE
echo "Exit code: $?"
Cron syntax reference
┌───────────── minute (0-59)
│ ┌───────────── hour (0-23)
│ │ ┌───────────── day of month (1-31)
│ │ │ ┌───────────── month (1-12)
│ │ │ │ ┌───────────── day of week (0-7, 0 and 7 = Sunday)
│ │ │ │ │
* * * * * command
Common patterns
0 8 * * * df -h / | awk 'NR==2 && $5+0 > 80 {print "Disk alert: " $5 " used"}' | mail -s "Disk Warning" you@email.com
0 3 * * 0 find /tmp -type f -mtime +7 -delete
0 2 * * * pg_dump mydb > /backups/db_$(date +\%Y\%m\%d).sql
*/5 * * * * systemctl is-active myservice || systemctl restart myservice
*/15 * * * * echo "$(date): $(uptime)" >> /var/log/system-stats.log
Environment variables in cron
(crontab -l 2>/dev/null; echo "PATH=/usr/local/bin:/usr/bin:/bin
SHELL=/bin/bash
0 2 * * * /home/user/backup.sh >> /var/log/backup.log 2>&1") | crontab -
Redirect output (important!)
* * * * * command >> /var/log/myjob.log 2>&1
* * * * * command > /dev/null 2>&1
MAILTO=you@email.com
0 8 * * * command
Examples
User: "Run my backup script every night at 2am"
→ (crontab -l 2>/dev/null; echo "0 2 * * * /home/user/backup.sh >> /var/log/backup.log 2>&1") | crontab -
User: "Check disk space every hour and alert me if it's over 80%"
→ Create a check script + cron job
User: "What scheduled tasks are running?"
→ List all crontabs and system cron directories
User: "Stop the daily cleanup job"
→ Find and remove the specific cron entry
Constraints
- Cron runs with minimal PATH — use absolute paths for commands
- Always redirect output (>> logfile 2>&1) or cron fills up mail spool
- Cron uses the system timezone — check with
timedatectl
- Minimum resolution is 1 minute — for sub-minute, use a loop in a script
- User crontabs don't survive user deletion
- Test commands manually before scheduling