Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sysutils

Languages / Idiomas: Español (ES) · English (EN)


ES

Utilidad de línea de comandos para Linux con herramientas de sistema: monitorización, backups, limpieza, diagnóstico y escaneo de red.

Funciona como comandos reales (git, docker, systemctl): tras instalar, escribes sysutils en bash o zsh.

Versión actual: 1.0.0 (MVP)


Requisitos

  • Linux (Ubuntu, Debian, Fedora, Arch, etc.)
  • Bash 4 o superior
  • Git (para clonar el repositorio)
  • zsh (opcional; sysutils configura ambos shells)

Herramientas opcionales (mejoran algunos comandos):

  • nmap — escaneo de red más completo
  • sensors — temperatura del sistema
  • tar, ping, ip — incluidos en la mayoría de distribuciones

Instalación paso a paso

1. Descargar el proyecto

Abre una terminal y clona el repositorio en la ruta que prefieras:

cd /home/USUARIO/proyectos
git clone <URL_DEL_REPOSITORIO> sysutils
cd sysutils

Sustituye /home/USUARIO por tu usuario real (por ejemplo /home/juan).

2. Dar permisos de ejecución

chmod +x sysutils.sh install.sh uninstall.sh bin/sysutils

3. Ejecutar el asistente de instalación

./sysutils.sh

No necesitas sudo para la instalación por defecto.

El asistente te guiará:

  1. Ubicación: usar la carpeta actual o copiar a /home/USUARIO/.local/share/sysutils
  2. Configuración: directorio de backups, papelera, caché, días de retención y nivel de log
  3. Shell: registrará sysutils en tu .bashrc y .zshrc

4. Recargar la terminal

# Si usas bash:
source /home/USUARIO/.bashrc

# Si usas zsh:
source /home/USUARIO/.zshrc

O cierra y abre una terminal nueva.

5. Verificar que funciona

sysutils --version
sysutils doctor
sysutils monitor

Si ves la versión y la salida de los comandos, la instalación fue exitosa.


Uso diario

Tras instalar, usa sysutils desde cualquier directorio:

sysutils <comando> [opciones]

Comandos disponibles (v1)

Comando Descripción
monitor CPU, RAM, disco, temperatura, uptime, IP, etc.
backup Crear, listar, restaurar y limpiar backups
cleanup Limpiar temporales, papelera y caché
doctor Verificar herramientas importantes instaladas
netscan Descubrir equipos en la red local

Ejemplos por comando

monitor

sysutils monitor

Muestra hostname, kernel, IP, uptime, CPU, RAM, disco y temperatura.

backup

# Crear backup del directorio home
sysutils backup create

# Crear backup de una ruta específica
sysutils backup create /home/USUARIO/documentos

# Listar backups
sysutils backup list

# Restaurar un backup
sysutils backup restore backup_2026-07-07_12-00-00.tar.gz

# Eliminar backups antiguos (según AUTO_DELETE_DAYS)
sysutils backup clean

cleanup

sysutils cleanup --temp     # temporales antiguos
sysutils cleanup --trash    # vaciar papelera
sysutils cleanup --cache    # limpiar caché del usuario
sysutils cleanup --all      # todas las opciones anteriores

Siempre pide confirmación antes de eliminar archivos.

doctor

sysutils doctor

Comprueba: Git, cURL, Wget, SSH, Nmap, GCC, Python y Node.

netscan

sysutils netscan

Si nmap está instalado, usa escaneo avanzado. Si no, usa ping + tabla ARP.


Configuración

El archivo de configuración está en:

/home/USUARIO/proyectos/sysutils/config/config.conf

(o en /home/USUARIO/.local/share/sysutils/config/config.conf si elegiste copiar al instalar)

Variables disponibles

Variable Descripción Valor por defecto
BACKUP_DIR Directorio donde se guardan los backups /home/USUARIO/backups
LOG_LEVEL Nivel de log: DEBUG, INFO, WARN, ERROR INFO
AUTO_DELETE_DAYS Días antes de eliminar backups antiguos 30
TEMP_DIRS Directorios temporales a limpiar /tmp /var/tmp
TRASH_DIR Ubicación de la papelera /home/USUARIO/.local/share/Trash
CACHE_DIRS Directorios de caché del usuario /home/USUARIO/.cache

Editar configuración manualmente

Abre el archivo con tu editor:

nano /home/USUARIO/proyectos/sysutils/config/config.conf

Ejemplo de contenido:

BACKUP_DIR="/home/USUARIO/backups"
LOG_LEVEL="INFO"
AUTO_DELETE_DAYS=30
TEMP_DIRS="/tmp /var/tmp"
TRASH_DIR="/home/USUARIO/.local/share/Trash"
CACHE_DIRS="/home/USUARIO/.cache"

Guarda el archivo. Los cambios aplican en la siguiente ejecución de sysutils.

Reconfigurar con el asistente

Puedes volver a ejecutar el asistente:

cd /home/USUARIO/proyectos/sysutils
rm -f .installed
./sysutils.sh

Compatibilidad bash y zsh

sysutils está escrito en Bash, pero funciona en ambos shells porque la instalación añade este bloque a .bashrc y .zshrc:

# sysutils - inicio
export SYSUTILS_ROOT="/home/USUARIO/proyectos/sysutils"
export PATH="$SYSUTILS_ROOT/bin:$PATH"
# sysutils - fin
  • No se usan enlaces simbólicos
  • No necesitas alias adicionales
  • El comando sysutils queda disponible globalmente tras recargar la shell

Estructura del proyecto

sysutils/
├── sysutils.sh          # Punto de entrada inicial (instalación)
├── bin/sysutils         # Comando principal
├── commands/            # Comandos individuales
├── lib/                 # Librerías compartidas
├── config/config.conf   # Configuración
├── logs/                # Registros diarios
├── install.sh           # Lógica del asistente
├── uninstall.sh         # Desinstalación
└── README.md

Desinstalación

Desde el directorio del proyecto:

cd /home/USUARIO/proyectos/sysutils
chmod +x uninstall.sh
./uninstall.sh

El script:

  • Elimina el bloque PATH de .bashrc y .zshrc
  • Pregunta si borrar copias, backups y logs
  • No usa enlaces simbólicos

Recarga la shell después:

source /home/USUARIO/.bashrc
# o
source /home/USUARIO/.zshrc

Solución de problemas

sysutils: command not found

Recarga tu shell:

source ~/.bashrc   # bash
source ~/.zshrc    # zsh

Verifica que el bloque # sysutils - inicio existe en tu archivo de configuración de shell.

El asistente no inicia

chmod +x sysutils.sh
./sysutils.sh

nmap no instalado en netscan

El comando funciona con un escaneo básico. Para mejor resultado:

sudo apt install nmap        # Debian/Ubuntu
sudo dnf install nmap        # Fedora
sudo pacman -S nmap            # Arch

Permisos al limpiar temporales

cleanup solo elimina archivos propios del usuario en directorios temporales. No requiere root.

Logs del sistema

Los registros se guardan en:

/home/USUARIO/proyectos/sysutils/logs/YYYY-MM-DD.log

Licencia

MIT — ver LICENSE.


EN

Linux command-line utility with system tools: monitoring, backups, cleanup, diagnostics, and network scanning.

It works like real commands (git, docker, systemctl): after installation, you type sysutils in bash or zsh.

Current version: 1.0.0 (MVP)


Requirements

  • Linux (Ubuntu, Debian, Fedora, Arch, etc.)
  • Bash 4 or higher
  • Git (to clone the repository)
  • zsh (optional; sysutils configures both shells)

Optional tools (improve some commands):

  • nmap — more complete network scanning
  • sensors — system temperature
  • tar, ping, ip — included in most distributions

Step-by-step installation

1. Download the project

Open a terminal and clone the repository to your preferred path:

cd /home/USER/projects
git clone <REPOSITORY_URL> sysutils
cd sysutils

Replace /home/USER with your actual username (for example /home/john).

2. Grant execute permissions

chmod +x sysutils.sh install.sh uninstall.sh bin/sysutils

3. Run the installation wizard

./sysutils.sh

You do not need sudo for the default installation.

The wizard will guide you through:

  1. Location: use the current folder or copy to /home/USER/.local/share/sysutils
  2. Configuration: backup directory, trash, cache, retention days, and log level
  3. Shell: registers sysutils in your .bashrc and .zshrc

4. Reload your terminal

# If you use bash:
source /home/USER/.bashrc

# If you use zsh:
source /home/USER/.zshrc

Or close and open a new terminal window.

5. Verify it works

sysutils --version
sysutils doctor
sysutils monitor

If you see the version and command output, the installation was successful.


Daily usage

After installation, use sysutils from any directory:

sysutils <command> [options]

Available commands (v1)

Command Description
monitor CPU, RAM, disk, temperature, uptime, IP, etc.
backup Create, list, restore, and clean backups
cleanup Clean temp files, trash, and cache
doctor Check important installed tools
netscan Discover devices on the local network

Examples by command

monitor

sysutils monitor

Shows hostname, kernel, IP, uptime, CPU, RAM, disk, and temperature.

backup

# Create a backup of the home directory
sysutils backup create

# Create a backup of a specific path
sysutils backup create /home/USER/documents

# List backups
sysutils backup list

# Restore a backup
sysutils backup restore backup_2026-07-07_12-00-00.tar.gz

# Delete old backups (based on AUTO_DELETE_DAYS)
sysutils backup clean

cleanup

sysutils cleanup --temp     # old temp files
sysutils cleanup --trash    # empty trash
sysutils cleanup --cache    # clean user cache
sysutils cleanup --all      # all of the above

Always asks for confirmation before deleting files.

doctor

sysutils doctor

Checks: Git, cURL, Wget, SSH, Nmap, GCC, Python, and Node.

netscan

sysutils netscan

If nmap is installed, uses advanced scanning. Otherwise, uses ping + ARP table.


Configuration

The configuration file is located at:

/home/USER/projects/sysutils/config/config.conf

(or at /home/USER/.local/share/sysutils/config/config.conf if you chose to copy during installation)

Available variables

Variable Description Default value
BACKUP_DIR Directory where backups are stored /home/USER/backups
LOG_LEVEL Log level: DEBUG, INFO, WARN, ERROR INFO
AUTO_DELETE_DAYS Days before deleting old backups 30
TEMP_DIRS Temp directories to clean /tmp /var/tmp
TRASH_DIR Trash location /home/USER/.local/share/Trash
CACHE_DIRS User cache directories /home/USER/.cache

Edit configuration manually

Open the file with your editor:

nano /home/USER/projects/sysutils/config/config.conf

Example content:

BACKUP_DIR="/home/USER/backups"
LOG_LEVEL="INFO"
AUTO_DELETE_DAYS=30
TEMP_DIRS="/tmp /var/tmp"
TRASH_DIR="/home/USER/.local/share/Trash"
CACHE_DIRS="/home/USER/.cache"

Save the file. Changes apply on the next sysutils run.

Reconfigure with the wizard

You can run the wizard again:

cd /home/USER/projects/sysutils
rm -f .installed
./sysutils.sh

bash and zsh compatibility

sysutils is written in Bash but works in both shells because installation adds this block to .bashrc and .zshrc:

# sysutils - inicio
export SYSUTILS_ROOT="/home/USER/projects/sysutils"
export PATH="$SYSUTILS_ROOT/bin:$PATH"
# sysutils - fin
  • No symbolic links are used
  • No additional aliases are needed
  • The sysutils command is available globally after reloading your shell

Project structure

sysutils/
├── sysutils.sh          # Initial entry point (installation)
├── bin/sysutils         # Main command
├── commands/            # Individual commands
├── lib/                 # Shared libraries
├── config/config.conf   # Configuration
├── logs/                # Daily logs
├── install.sh           # Wizard logic
├── uninstall.sh         # Uninstallation
└── README.md

Uninstallation

From the project directory:

cd /home/USER/projects/sysutils
chmod +x uninstall.sh
./uninstall.sh

The script:

  • Removes the PATH block from .bashrc and .zshrc
  • Asks whether to delete copies, backups, and logs
  • Does not use symbolic links

Reload your shell afterwards:

source /home/USER/.bashrc
# or
source /home/USER/.zshrc

Troubleshooting

sysutils: command not found

Reload your shell:

source ~/.bashrc   # bash
source ~/.zshrc    # zsh

Verify the # sysutils - inicio block exists in your shell configuration file.

The wizard does not start

chmod +x sysutils.sh
./sysutils.sh

nmap not installed for netscan

The command works with basic scanning. For better results:

sudo apt install nmap        # Debian/Ubuntu
sudo dnf install nmap        # Fedora
sudo pacman -S nmap          # Arch

Permissions when cleaning temp files

cleanup only removes the user's own files in temp directories. Root is not required.

System logs

Logs are stored at:

/home/USER/projects/sysutils/logs/YYYY-MM-DD.log

License

MIT — see LICENSE.

About

Linux command-line utility with system tools: monitoring, backups, cleanup, diagnostics, and network scanning.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages