bhargavnova / python-helper-modules

MIT License
7 stars 24 forks source link

Cron Job Management Script for Linux 🕒🐧 #10

Open bhargavnova opened 9 months ago

bhargavnova commented 9 months ago

Objective:

Develop a Python script that allows users to perform CRUD (Create, Read, Update, Delete) operations for cron jobs on a Linux system. This script will provide an intuitive interface to manage scheduled tasks.

Features:

  1. Add New Cron Job:

    • Implement functionality to add a new cron job with a specified schedule and command.
  2. List Existing Cron Jobs:

    • Allow users to view a list of currently scheduled cron jobs.
  3. Edit Existing Cron Job:

    • Provide the ability to modify the schedule or command of an existing cron job.
  4. Remove Cron Job:

    • Enable users to delete a specific cron job based on its ID or schedule.

Example Usage:

# Example usage of the cron job management script
import cron_manager

# Add a new cron job
cron_manager.add_job("* * * * *", "/path/to/script.py")

# List existing cron jobs
cron_manager.list_jobs()

# Edit an existing cron job
cron_manager.edit_job(1, new_schedule="0 0 * * *", new_command="/path/to/updated_script.py")

# Remove a specific cron job
cron_manager.remove_job(2)

Difficulty: Intermediate/Advanced

Tags: Python, Linux, Cron Job, Task Scheduling, CRUD Operations

Additional Information:

Siddharth9890 commented 9 months ago

@bhargavnova can i work on this please?

bhargavnova commented 9 months ago

Sure!!

Thanks for picking this up @Siddharth9890 : ), The updated guidelines can be found here.