updating things
All checks were successful
Check scripts syntax / check-scripts-syntax (push) Successful in 35s

This commit is contained in:
2025-09-20 20:53:54 -03:00
parent 96548f4773
commit 61ade81d39
6 changed files with 10 additions and 1011 deletions

View File

@@ -1,20 +1,8 @@
#!/bin/bash
# System Cleanup and Maintenance Script
#
# Description: Comprehensive system cleanup for Docker containers and Linux systems
# Features:
# - Docker resource cleanup (images, containers, volumes, networks)
# - Package manager cache cleanup (APK/APT)
# - System cache and temporary file cleanup
# - Log rotation and cleanup
# - Memory cache optimization
# - Journal cleanup (systemd)
# - Thumbnail and user cache cleanup
# Author: ivanch
# Version: 2.0
set -euo pipefail # Exit on error, undefined vars, and pipe failures
set -euo pipefail
#==============================================================================
# CONFIGURATION
@@ -35,9 +23,6 @@ readonly JOURNAL_RETENTION_DAYS=7
readonly TEMP_DIRS=("/tmp" "/var/tmp")
readonly CACHE_DIRS=("/var/cache" "/root/.cache")
# Auto-update configuration
readonly AUTO_UPDATE_ENABLED=true
#==============================================================================
# UTILITY FUNCTIONS
#==============================================================================
@@ -147,12 +132,6 @@ cleanup_docker() {
return 0
fi
# Get initial Docker disk usage
local docker_usage_before=""
if docker system df >/dev/null 2>&1; then
docker_usage_before=$(docker system df 2>/dev/null || echo "")
fi
# Remove unused images
log_info "Removing unused Docker images..."
if docker image prune -af >/dev/null 2>&1; then
@@ -192,11 +171,6 @@ cleanup_docker() {
else
log_warning "Docker system cleanup failed"
fi
# Show space freed if possible
if [[ -n "$docker_usage_before" ]] && docker system df >/dev/null 2>&1; then
log_info "Docker cleanup completed"
fi
}
#==============================================================================