A comprehensive maintenance application for Arch Linux and Arch-based distributions (EndeavourOS, Manjaro, Artix, etc.).
This application provides automated maintenance tasks for Arch Linux systems, including system updates, package management, cache cleaning, orphan removal, and system optimization.
- Cross-shell compatibility: Works with bash, zsh, fish, and other POSIX-compliant shells
- Distribution agnostic: Works on Arch Linux and all Arch-based distributions
- Automated maintenance: System updates, cache cleaning, orphan package removal
- Security updates: Prioritizes security updates and system integrity
- Logging: Comprehensive logging of all maintenance activities
- Interactive mode: User prompts for critical operations
- Dry-run mode: Preview changes before applying them
- Package Management: Complete system updates, AUR package updates, orphaned package removal
- Cache Management: Package cache cleaning, system log cleanup, temporary file removal
- Database Updates: System databases (locate, man pages) maintenance
- Service Monitoring: Failed systemd service detection and reporting
- Temperature Monitoring: CPU, GPU, and system temperature tracking with alerts
- Disk Health: SMART status monitoring, disk usage analysis, SSD health metrics
- Memory Analysis: RAM and swap usage monitoring with leak detection
- Fan Speed Monitoring: System cooling status and fan curve analysis
- Vulnerability Assessment: System package security analysis
- Security Hardening: Comprehensive kernel and system security enhancements
- File Integrity Monitoring: AIDE-based file system integrity checking (566k+ files)
- Malware Detection: Linux-specific malware scanning with automatic updates
- Intrusion Prevention: fail2ban integration with automated threat blocking
- Authentication Security: Failed login analysis and user security auditing
- CPU Optimization: Governor settings, frequency scaling, microcode analysis
- Memory Optimization: Swappiness tuning, cache pressure optimization, leak detection
- Disk Optimization: SSD TRIM management, I/O scheduler optimization, filesystem analysis
- Network Optimization: TCP congestion control, buffer tuning, interface monitoring
- Boot Time Analysis: systemd-analyze integration with service optimization recommendations
- Performance Scoring: Real-time system performance scoring (0-10 scale) with optimization suggestions
archcare/
βββ README.md # This documentation
βββ arch_maintenance.sh # Main maintenance script
βββ scripts/ # Additional utility scripts
β βββ system_info.sh # System information gathering
β βββ package_manager.sh # Package management utilities
β βββ cleanup.sh # System cleanup utilities
βββ config/ # Configuration files
β βββ maintenance.conf # Main configuration
βββ logs/ # Log files directory
βββ tests/ # Test scripts
- Clone the repository:
git clone https://github.com/tedin7/archcare.git
cd archcareOr using SSH:
git clone git@github.com:tedin7/archcare.git
cd archcare- Make the script executable:
chmod +x arch_maintenance.sh- Run the maintenance script:
./arch_maintenance.sh# Interactive mode (includes hardware monitoring + security scan + performance optimization)
./arch_maintenance.sh
# Automatic mode (no prompts - includes all features)
./arch_maintenance.sh --auto
# Preview mode (see what would be done)
./arch_maintenance.sh --dry-run
# Complete system maintenance with all features
./arch_maintenance.sh --all# System updates only
./arch_maintenance.sh --update-only
# Cleanup operations only
./arch_maintenance.sh --clean-only
# Hardware health check only
./arch_maintenance.sh --health-check
# Security scanning only
./arch_maintenance.sh --security-scan
# Performance optimization only
./arch_maintenance.sh --performance
# Verbose output
./arch_maintenance.sh --verbose- Updates package databases
- Upgrades all installed packages
- Handles AUR packages (if yay/paru is installed)
- Kernel updates with reboot notifications
- Removes orphaned packages
- Cleans package cache
- Removes old cached packages
- Validates package integrity
- Clears system logs (keeps recent entries)
- Cleans temporary files
- Removes broken symlinks
- Cleans user cache directories
- Updates system databases (locate, man pages)
- Checks for failed systemd services
- Validates file system integrity
- Updates font cache
- CPU temperature monitoring with smart thresholds
- GPU temperature detection (NVIDIA, AMD, Intel)
- Disk health and SMART status checking
- Memory and swap usage analysis
- System load monitoring
- Battery status (for laptops)
- Security update detection and prioritization
- SSH configuration security analysis
- User account security validation
- File permission verification
- Network security assessment
- Rootkit and malware detection
- System integrity checking
- Failed login attempt monitoring
The config/maintenance.conf file allows customization of maintenance behavior:
# Automatic mode settings
AUTO_UPDATE=true
AUTO_CLEAN=true
AUTO_REBOOT=false
# Package cache settings
KEEP_CACHE_VERSIONS=3
MAX_CACHE_SIZE_GB=5
# Logging settings
LOG_LEVEL=INFO
LOG_RETENTION_DAYS=30- Arch Linux (official)
- EndeavourOS β (tested)
- Manjaro
- Artix Linux
- ArcoLinux
- Garuda Linux
- BlackArch
- Arch Linux or Arch-based distribution
pacmanpackage managersudoprivileges for system operations- Optional:
yayorparufor AUR support
All maintenance activities are logged to:
logs/maintenance.log- Main log filelogs/errors.log- Error-specific loglogs/updates.log- Package update history
- Confirmation prompts for critical operations
- Dry-run mode to preview changes
- Backup creation before major changes
- Rollback support for package operations
- Error handling with detailed logging
Run the test suite:
cd tests
./run_tests.sh- Fork the repository
- Create a feature branch
- Test on multiple Arch distributions
- Submit a pull request
- Basic maintenance script with cross-shell compatibility
- Support for all major Arch-based distributions
- Interactive and automatic modes
- Comprehensive logging system
- Safety features and error handling
This project is licensed under the MIT License - see the LICENSE file for details.
For issues, questions, or contributions:
- Create an issue on the repository
- Check the logs directory for detailed error information
- Test with
--dry-runfirst for troubleshooting
The ArchCare system has been significantly hardened with comprehensive security measures:
- File:
/etc/sysctl.d/99-security-hardening.conf - Features:
- Kernel message restrictions (
kernel.dmesg_restrict = 1) - Pointer protection (
kernel.kptr_restrict = 2) - SysRq disabled (
kernel.sysrq = 0) - Unprivileged BPF disabled (
kernel.unprivileged_bpf_disabled = 1) - Ptrace scope protection (
kernel.yama.ptrace_scope = 1) - Network security hardening (redirects, source routing, etc.)
- Kernel message restrictions (
- File:
/etc/login.defs(enhanced) - Features:
- Maximum password age: 90 days
- Minimum password age: 1 day
- Password warning: 14 days
- Secure umask: 027
- Strong password hashing: SHA-256/512 with high rounds
- auditd: Comprehensive security event logging
- File Integrity: AIDE with 566k+ file database
- Malware Detection: Linux Malware Detect (maldet)
- Intrusion Prevention: fail2ban
- Firewall: firewalld with hardened rules
- SSH: Service disabled and removed from firewall
- Network hardening: Comprehensive sysctl network protections
- AppArmor: Mandatory access control (requires reboot)
- File Permissions: Hardened default umask (027)
- User Security: Enhanced login controls
- β Kernel hardening enabled
- β Security logging (auditd) active
- β File integrity monitoring (AIDE) installed
- β Malware detection (maldet) installed
- β Intrusion prevention (fail2ban) running
- β Firewall hardened (SSH removed)
- β Secure file permissions (umask 027)
- β Network security hardening applied
- AppArmor: Needs kernel parameter
apparmor=1 security=apparmor - System Reboot: Required for kernel updates and AppArmor activation
- Password Policy: May need manual verification
The enhanced security scanner now includes hardening verification:
# Run complete security scan with hardening verification
./arch_maintenance.sh --security-scan
# Run security scanner directly
bash scripts/security_scanner.sh- Immediate: Reboot system to activate kernel updates and AppArmor
- Regular: Run security scans weekly with
--security-scan - Monitoring: Check
/var/log/aide.logfor file integrity alerts - Updates: Keep security tools updated with automatic signature updates
# Check AIDE file integrity
sudo aide --check
# Update AIDE database
sudo aide --update
# Check AppArmor status
sudo aa-status
# View security logs
sudo journalctl -u auditd
# Check fail2ban status
sudo fail2ban-client statusLast Updated: June 21, 2025 Tested On: EndeavourOS (Arch Linux based) Shell Compatibility: bash, zsh, fish, dash