Skip to content

cwhit-io/systemd-timer-manager

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Systemd Timer Manager for Cockpit

A Cockpit plugin for managing systemd timers through a user-friendly web interface. This plugin allows system administrators to create, edit, delete, and monitor systemd timers without having to use the command line.

Systemd Timer Manager Screenshot

Features

  • View all systemd timers in a clean, sortable table interface
  • Create new timers with an easy-to-use form
  • Edit existing timers to modify their schedule, command, or other properties
  • Start, stop, and run timers and their associated services
  • Delete timers that are no longer needed
  • View logs for timer services directly in Cockpit's journal viewer
  • Filter and search to quickly find specific timers
  • Schedule validation to ensure your timer schedules are correctly formatted
  • Schedule examples for common use cases

Installation

Prerequisites

  • A Linux system with systemd
  • Cockpit installed (version 122 or later)
  • Administrative privileges

Manual Installation

  1. Clone this repository:

    git clone https://github.com/yourusername/systemd-timer-manager.git
  2. Create the plugin directory if it doesn't exist:

    sudo mkdir -p /usr/share/cockpit/systemd-timer-manager
  3. Copy the plugin files:

    sudo cp -r systemd-timer-manager/* /usr/share/cockpit/systemd-timer-manager/
  4. Restart Cockpit:

    sudo systemctl restart cockpit
  5. Access Cockpit in your browser (usually at https://your-server-ip:9090) and look for "Timer Manager" in the menu.

RPM Package Installation (if available)

sudo dnf install cockpit-systemd-timer-manager

Usage

Viewing Timers

The main view displays all systemd timers on your system with the following information:

  • Timer name
  • Description
  • Last run time
  • Next scheduled run time
  • Current status
  • Action buttons

Creating a Timer

  1. Click the "Create New Timer" button
  2. Fill in the required fields:
    • Timer Name: A unique name for your timer (without .timer extension)
    • Description: What the timer does
    • Schedule: When the timer should run (see below for format)
    • Command: The command to execute
  3. Optional fields:
    • Run as User: Username to run the command as
    • Persistent: Whether to run immediately if a scheduled time was missed during system downtime
    • Run on Boot: Whether to run once after system boot
    • Run on Unit Activation: Whether to run when the unit becomes active
  4. Click "Save"

Timer Schedule Format

The schedule field accepts systemd calendar time specifications:

  • daily - Run once a day at midnight
  • weekly - Run once a week at midnight on Monday
  • monthly - Run once a month at midnight on the first day
  • yearly - Run once a year at midnight on January 1st
  • *:0/15 - Run every 15 minutes
  • Mon..Fri 09:00 - Run at 9 AM on weekdays
  • Sat,Sun 10:00 - Run at 10 AM on weekends
  • *-*-01 02:00 - Run at 2 AM on the first day of every month

You can validate your schedule format using the "Validate Schedule" button.

Managing Timers

For each timer, you can:

  • Edit: Modify the timer's properties
  • Start/Stop: Enable or disable the timer
  • Run Now: Execute the timer's service immediately
  • View Logs: See the output from previous runs
  • Delete: Remove the timer from the system

Development

Project Structure

  • index.html - Main HTML file
  • css/ - CSS stylesheets
  • js/ - JavaScript files:
    • main.js - Entry point and initialization
    • systemd-service.js - Backend service for interacting with systemd
    • ui-controller.js - UI controller handling user interactions
  • manifest.json - Cockpit plugin manifest

Building from Source

  1. Clone the repository:

    git clone https://github.com/yourusername/systemd-timer-manager.git
    cd systemd-timer-manager
  2. Make your changes to the source files

  3. Test the plugin:

    mkdir -p ~/.local/share/cockpit/systemd-timer-manager
    cp -r * ~/.local/share/cockpit/systemd-timer-manager/
  4. Restart Cockpit and test your changes

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

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

Acknowledgments

  • The Cockpit Project team for creating an excellent web-based server manager
  • The systemd developers for their powerful timer functionality

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published