Skip to content

Goal651/cron_gui

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

15 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Cron GUI

A modern, beautiful Linux desktop application for managing cron jobs with a graphical interface. Built with Python and GTK4.

License Python

Features

โœจ Modern GTK4 Interface - Beautiful, native Linux look with Adwaita styling
๐Ÿ“‹ Easy Job Management - View, add, edit, and delete cron jobs with a few clicks
๐Ÿ” Search & Filter - Quickly find jobs with the built-in search
โฐ Cron Expression Builder - No need to remember cron syntax
โœ… Real-time Validation - Instant feedback on cron expressions
๐Ÿ”ฎ Next Run Preview - See when your jobs will execute next
๐ŸŽจ Quick Presets - Common schedules (hourly, daily, weekly, monthly)
๐Ÿ”„ Enable/Disable Jobs - Toggle jobs on and off without deleting
๐Ÿ’ฌ Job Comments - Add descriptions to your cron jobs

Screenshots

Coming soon - run the app to see the beautiful interface!

Requirements

  • OS: Linux (tested on Ubuntu/Debian-based distributions)

  • Python: 3.8 or higher

  • GTK: GTK4 and libadwaita

  • System packages:

    sudo apt install python3-gi python3-gi-cairo gir1.2-gtk-4.0 gir1.2-adw-1

Installation

  1. Clone the repository:

    git clone https://github.com/yourusername/cron_gui.git
    cd cron_gui
  2. Create and activate virtual environment:

    python3 -m venv venv
    source venv/bin/activate
  3. Install Python dependencies:

    pip install -r requirements.txt
  4. Run the application:

    python3 main.py

Usage

Running the Application

Simply execute:

python3 main.py

Or if you want to add it to your application menu:

# Copy the desktop file to your local applications directory
cp cron-gui.desktop ~/.local/share/applications/
# Update the Exec path in the file to match your installation location

Managing Cron Jobs

Adding a Job:

  1. Click the + button in the header bar
  2. Enter the command to execute
  3. Choose a preset or build a custom schedule
  4. Add an optional comment
  5. Click "Save"

Editing a Job:

  1. Click the edit button (pencil icon) on any job
  2. Modify the fields as needed
  3. Click "Save"

Deleting a Job:

  1. Click the delete button (trash icon) on any job
  2. Confirm the deletion

Enabling/Disabling a Job:

  • Use the toggle switch on each job row

Searching:

  • Click the search icon or press Ctrl+F
  • Type to filter jobs by command, schedule, or comment

Cron Expression Guide

Cron expressions consist of 5 fields:

* * * * *
โ”‚ โ”‚ โ”‚ โ”‚ โ”‚
โ”‚ โ”‚ โ”‚ โ”‚ โ””โ”€โ”€โ”€ Day of week (0-6, 0=Sunday)
โ”‚ โ”‚ โ”‚ โ””โ”€โ”€โ”€โ”€โ”€ Month (1-12)
โ”‚ โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€ Day of month (1-31)
โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ Hour (0-23)
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ Minute (0-59)

Examples:

  • * * * * * - Every minute
  • 0 * * * * - Every hour
  • 0 0 * * * - Daily at midnight
  • 0 0 * * 0 - Weekly on Sunday at midnight
  • 0 0 1 * * - Monthly on the 1st at midnight
  • */5 * * * * - Every 5 minutes
  • 0 */2 * * * - Every 2 hours

What Can You Do With Cron Jobs?

Here are some powerful ways to use Cron GUI:

๐Ÿš€ System Maintenance

  • Backups: Automatically zip and move files to a backup drive every night
    • 0 3 * * * /scripts/backup.sh
  • Cleanup: Delete temporary files older than 7 days
    • 0 4 * * * find /tmp -mtime +7 -delete
  • Log Rotation: Archive and clear log files to save space

๐ŸŒ Web & Development

  • Status Checks: Ping your website every 5 minutes
    • */5 * * * * curl -s https://mysite.com > /dev/null
  • Data Fetching: Run a script to scrape a website or fetch API data every hour
  • Certificate Renewal: Auto-renew SSL certificates

๐Ÿ  Personal Automation

  • Reminders: Send yourself a desktop notification
    • 0 9 * * 1 notify-send "Weekly Meeting"
  • Downloads: Schedule heavy downloads for off-peak hours (e.g., 2 AM)
  • Wallpaper Switcher: Change your desktop wallpaper every hour

Building and Distribution

Building the Package

To build a distributable Python package (wheel and source distribution):

  1. Install build tools:

    pip install build
  2. Build the package:

    python3 -m build

    Or using setup.py directly (legacy):

    python3 setup.py sdist bdist_wheel
  3. Artifacts: The built packages will be in the dist/ directory:

    • cron_gui-0.1.0-py3-none-any.whl (Wheel)
    • cron_gui-0.1.0.tar.gz (Source tarball)

Installing from Build

You can install the built package using pip:

pip install dist/cron_gui-0.1.0-py3-none-any.whl

This will install the cron-gui command globally (or in your active environment).

Creating a Debian Package (.deb)

To create a native Debian package for easy installation on Ubuntu/Debian/Kali:

  1. Run the build script:

    ./build_deb.sh
  2. Install the package:

    sudo dpkg -i dist/cron-gui_0.1.0_all.deb
    sudo apt-get install -f  # Install dependencies if needed
  3. Run: You can now launch "Cron GUI" from your system menu!

Development

Project Structure

cron_gui/
โ”œโ”€โ”€ cron_gui/
โ”‚   โ”œโ”€โ”€ __init__.py          # Package initialization
โ”‚   โ”œโ”€โ”€ cron_manager.py      # Backend cron management
โ”‚   โ”œโ”€โ”€ cron_parser.py       # Cron expression utilities
โ”‚   โ”œโ”€โ”€ job_dialog.py        # Add/Edit dialog
โ”‚   โ”œโ”€โ”€ job_list.py          # Job list view
โ”‚   โ””โ”€โ”€ window.py            # Main application window
โ”œโ”€โ”€ main.py                  # Application entry point
โ”œโ”€โ”€ requirements.txt         # Python dependencies
โ”œโ”€โ”€ setup.py                 # Package setup
โ”œโ”€โ”€ cron-gui.desktop        # Desktop entry file
โ””โ”€โ”€ README.md               # This file

Contributing

Contributions are welcome! Please see CONTRIBUTING.md for details.

Troubleshooting

"Failed to initialize crontab"

  • Make sure you have cron installed: sudo apt install cron
  • Check if the cron service is running: systemctl status cron

GTK/Adwaita import errors

  • Install system packages: sudo apt install python3-gi gir1.2-gtk-4.0 gir1.2-adw-1

Permission errors

  • The app manages your user's crontab by default
  • For system-wide cron jobs, you may need elevated privileges

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

Support

If you encounter any issues or have questions, please open an issue on GitHub.

About

This is cron tool gui

Resources

License

Contributing

Stars

Watchers

Forks

Packages

No packages published