Skip to content

Sysopctl is a custom command-line tool designed for managing system resources, processes, and services on macOS.

Notifications You must be signed in to change notification settings

Priyansu-Bhandari/Sysopctl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

sysopctl - System Operations Control Command

Overview

sysopctl is a custom command-line tool designed for managing system resources, processes, and services on macOS. The tool simplifies system administration tasks by providing a single interface to perform various operations, such as viewing system load, managing services, and monitoring processes.

Project Structure

The project directory is organized as follows:

projectcmd/
│
├── sysopctl       # The main Bash script for sysopctl command
└── README.md      # This README file

Problem Solving Approach

The sysopctl command was developed to address the need for a streamlined and efficient way to manage system resources on macOS. The approach focused on creating a simple, user-friendly command-line tool that integrates various system management tasks into a single interface.

Problem Solving Approach

The sysopctl command was developed to address the need for a streamlined and efficient way to manage system resources on macOS. The approach focused on creating a simple, user-friendly command-line tool that integrates various system management tasks into a single interface.

Key Considerations:

  • Simplicity: The tool is designed to be easy to use with a clear and intuitive syntax.
  • Modularity: Each feature (e.g., service management, system load monitoring) is implemented as a separate command within sysopctl, making it easy to extend and maintain.
  • Compatibility: The tool is built specifically for macOS, utilizing native macOS commands like launchctl, uptime, and df.

Installation

Prerequisites

  • macOS
  • Basic knowledge of using the terminal
  • Bash shell

Setup Instructions

Clone the Repository

If you haven't already created your project directory, clone the repository:

git clone https://your-repository-url.git
cd projectcmd

Create the Script File

The main script file is named sysopctl. If you haven't created it yet, use the following commands:

touch sysopctl
chmod +x sysopctl

Edit the Script

Open the script in a text editor:

nano sysopctl

Add the basic structure for the command as described in the earlier steps. The script handles various options like --help, --version, and subcommands for managing services, system load, etc.

Add the Script to PATH

To make sysopctl accessible from anywhere in the terminal, add the directory to your PATH. Add the following line to your .bash_profile or .zshrc:

export PATH=$PATH:~/projectcmd

After editing, run:

source ~/.bash_profile  # or source ~/.zshrc

Usage

sysopctl provides several commands to manage system resources. Here’s how you can use it:

Display Help

sysopctl --help

This command displays the help message, listing all available options and subcommands.

Display Version

sysopctl --version

This command displays the current version of the sysopctl tool.

Service Management

List Active Services:

sysopctl service list

Lists all active services using launchctl list.

Start a Service:

sysopctl service start <service-name>

Starts a specified service using launchctl start .

Stop a Service:

sysopctl service stop <service-name>

Stops a specified service using launchctl stop .

System Load

sysopctl system load

Displays the current system load averages, similar to the output of the uptime command.

Disk Usage

sysopctl disk usage

Shows disk usage statistics by partition, similar to the df -h command.

Process Monitoring

sysopctl process monitor

Monitors real-time process activity, providing a view similar to the top command.

Log Analysis

sysopctl logs analyze

Summarizes recent critical log entries, potentially using log show or journalctl.

Backup Files

sysopctl backup <path>

Initiates a backup of the specified directory, potentially using rsync.

Example Workflow Diagram

Below is a conceptual representation of the command workflow:

Start
   |
   v
Command? ------------------
  |        |        |        |        |         |        |        |
--help   --version   service   system   disk    process   logs   backup
  |        |         |        |        |         |        |        |    
Display   Display   Service   System   Disk   Process   Logs    Backup
Help      Version   |        |        |         |        |        |    
                   |        |        |         |        |        |    
                   list    load   usage     monitor analyze  <path>
                   |       |       |          |       |        |
              List Active  Show   Display   Monitor  Analyze   Backup Files
              Services     System  Disk     Processes Logs
                          Load

Contributing

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

Versioning

This project uses Semantic Versioning for versioning. The current version is 0.1.0.

About

Sysopctl is a custom command-line tool designed for managing system resources, processes, and services on macOS.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages