Scheduler cron integration

From NaveedTechLab/skills-library · View interactive version

Scheduler cron integration is an AI agent skill from the GitHub repository NaveedTechLab/skills-library. Set up scheduled execution for recurring operations using cron-like expressions. Use when you need daily summaries, weekly audits, or any time-triggered automated task within Claude Code workflows.

How to use this skill

Skill file

Scheduler Cron Integration

Description

The Scheduler Cron Integration skill provides scheduled execution capabilities for recurring operations such as daily summaries and weekly audits. This skill enables Claude Code to automatically execute tasks at specified intervals using cron-like expressions and provides a comprehensive task scheduling system.

Purpose

This skill implements robust scheduling functionality to:

Key Features

Cron Expression Support

Job Management

Schedule Types

Execution Engine

Configuration

Default Configuration

{
  "scheduler": {
    "enabled": true,
    "max_concurrent_jobs": 10,
    "job_storage_path": "./scheduled_jobs",
    "log_retention_days": 30,
    "check_interval_seconds": 30
  },
  "cron": {
    "support_seconds": true,
    "timezone": "UTC",
    "max_execution_time_minutes": 60
  },
  "jobs": {
    "default_timeout_minutes": 10,
    "max_retries": 3,
    "retry_delay_seconds": 30
  }
}

Example Job Definitions

[
  {
    "id": "daily_summary",
    "name": "Daily Summary Report",
    "cron_expression": "0 9 * * *",  // Every day at 9 AM
    "command": "generate_daily_summary",
    "enabled": true,
    "description": "Generates daily summary report"
  },
  {
    "id": "weekly_audit",
    "name": "Weekly Security Audit",
    "cron_expression": "0 2 * * 0",  // Every Sunday at 2 AM
    "command": "perform_security_audit",
    "enabled": true,
    "description": "Performs weekly security audit"
  },
  {
    "id": "monthly_cleanup",
    "name": "Monthly Cleanup",
    "cron_expression": "0 1 1 * *",  // First day of every month at 1 AM
    "command": "cleanup_old_files",
    "enabled": true,
    "description": "Cleans up old temporary files"
  }
]

Usage Scenarios

Basic Job Scheduling

from scheduler_cron_integration import Scheduler

scheduler = Scheduler()
job_id = scheduler.schedule_job(
    name="daily_backup",
    cron_expression="0 2 * * *",  # Daily at 2 AM
    callback_function=backup_function,
    args=[param1, param2],
    description="Daily backup operation"
)

Dynamic Job Management

# Pause a job
scheduler.pause_job("daily_backup")

# Resume a job
scheduler.resume_job("daily_backup")

# Update job schedule
scheduler.update_job_schedule("daily_backup", "0 3 * * *")  # Move to 3 AM

# Cancel a job
scheduler.cancel_job("daily_backup")

Job Status and Monitoring

# Get job status
status = scheduler.get_job_status("daily_backup")
print(f"Next run: {status.next_run}")
print(f"Last run: {status.last_run}")
print(f"Execution count: {status.execution_count}")

# Get execution history
history = scheduler.get_job_history("daily_backup", limit=10)
for record in history:
    print(f"Run at {record.timestamp}: {record.status} ({record.duration}s)")

Integration Points

With Claude Code

With External Systems

Error Handling

Execution Failures

System Issues

Security Considerations

Performance Considerations

Dependencies

When NOT to Use This Skill

Common Mistakes

Related Skills

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.