Regular Maintenance Tasks
System Updates
Update All LXC Containers
Keep all containers up-to-date with the latest packages:Update Process
Update Process
- Detects all LXC containers on the host
- Allows selection of containers to skip
- Option to skip stopped containers
- Automatically identifies package manager (apt, apk, dnf, yum, pacman)
- Runs update and upgrade commands
- Reports success or failure for each container
For automated updates, use the cron-based version:This installs a weekly cron job for automatic container updates.
Update Applications
Update self-hosted applications within containers:- Docker containers
- Node.js applications
- Python applications
- Custom update scripts
- Binary-based applications
Cleanup Operations
Container Cleanup
Remove unnecessary packages and clear cache:Package Cache
Clears APT/DNF/YUM package caches to free disk space
Unused Packages
Removes automatically installed packages no longer needed
Log Rotation
Truncates old log files
Temp Files
Cleans temporary directories
/var/cache/apt/archives/(Debian/Ubuntu)/var/cache/dnf/(Fedora/Rocky)/var/cache/yum/(CentOS)/tmp/temporary files- Orphaned packages
- Old log files
Clean Orphaned LVM Volumes
Remove LVM volumes no longer associated with containers:- Scans for LVM volumes not linked to any container
- Lists orphaned volumes with sizes
- Prompts for confirmation before deletion
- Removes selected volumes and frees space
Kernel Cleanup
Remove old kernel versions:Kernel Cleanup Process
Kernel Cleanup Process
- Detects currently running kernel (automatically excluded)
- Lists all installed kernel versions
- Displays kernel sizes
- Allows interactive selection of kernels to remove
- Removes selected kernel packages and associated files
- Updates GRUB configuration
- Frees
/bootpartition space - Reduces package update overhead
- Simplifies kernel management
- Prevents boot partition full errors
Storage Maintenance
FSTRIM for SSDs
Optimize SSD performance with periodic TRIM operations:FSTRIM helps maintain SSD performance and longevity by informing the SSD which blocks are no longer in use.
- Enables weekly fstrim.timer systemd service
- Runs TRIM on all mounted filesystems with SSD support
- Logs TRIM operations for monitoring
- Configurable schedule via systemd timer
Backup Operations
Host Configuration Backup
Backup critical Proxmox host configuration:Backup Includes
Backup Includes
/etc/- System configuration files/etc/pve/- Proxmox VE configuration/etc/network/- Network settings/etc/apt/- Repository configuration- Custom directories (optional)
- Run the script
- Specify backup destination (default:
/root/) - Choose directory to backup (default:
/etc/) - Select specific subdirectories or backup all
- Script creates compressed tar archive
Container Backup and Restore
Restore containers from Proxmox backups:- Lists available backup files
- Allows selection of backup to restore
- Prompts for new container ID
- Configures storage and resources
- Starts container after restore
Performance Optimization
CPU Microcode Updates
Install latest CPU microcode for security and stability:Intel
Installs intel-microcode and updates Intel CPU firmware
AMD
Installs amd64-microcode and updates AMD CPU firmware
- Security vulnerability patches (Spectre, Meltdown, etc.)
- CPU stability improvements
- Bug fixes and performance enhancements
- Thermal management improvements
CPU Scaling Governor
Optimize CPU frequency scaling:Available Governors
Available Governors
- performance: Maximum frequency always (best for compute-heavy loads)
- powersave: Minimum frequency always (best for power efficiency)
- ondemand: Dynamic scaling based on CPU load (balanced approach)
- conservative: Similar to ondemand but more gradual (smooth transitions)
- schedutil: Scheduler-driven frequency selection (modern default)
| Governor | Use Case | Power Usage | Performance |
|---|---|---|---|
| performance | Databases, transcoding, VMs | High | Maximum |
| powersave | Low-load servers, home labs | Minimum | Variable |
| ondemand | General purpose servers | Moderate | Good |
| conservative | Media servers, file servers | Low-Moderate | Good |
| schedutil | Modern kernels (5.9+) | Optimized | Excellent |
NIC Offloading Fixes
Resolve network performance issues:- Packet corruption in VMs/containers
- Slow network performance
- Connection drops
- Checksums errors
- TCP segmentation offload (TSO)
- Generic segmentation offload (GSO)
- Generic receive offload (GRO)
- Large receive offload (LRO)
- RX/TX checksumming
Health Monitoring
Monitor All Instances
Automatically monitor and restart failed instances:Monitoring Features
Monitoring Features
- Continuous ping monitoring: Checks instance responsiveness every minute
- Tag-based filtering: Only monitors instances with
mon-restarttag - Automatic restart: Restarts instances that fail ping checks
- Systemd service: Runs as background service
- Logging: Records all restart events
- Run the installation script
- Service is installed as systemd unit
- Tag instances you want monitored:
Maintenance Schedules
Recommended Maintenance Calendar
Daily Tasks
Daily Tasks
- Check systemd journal for errors:
journalctl -p err -b - Monitor disk usage:
df -h - Review backup status
- Check container/VM status in web UI
Weekly Tasks
Weekly Tasks
- Update containers:
update-lxcs.sh - Review security updates
- Check monitoring alerts
- Verify backup integrity
- Run FSTRIM (automatic if configured)
Monthly Tasks
Monthly Tasks
- Clean container caches:
clean-lxcs.sh - Remove old kernels:
kernel-clean.sh - Update Proxmox host:
apt update && apt dist-upgrade - Review and rotate logs
- Test backup restoration
- Update microcode if new versions available
- Check storage pool health
Quarterly Tasks
Quarterly Tasks
- Clean orphaned LVM volumes:
clean-orphaned-lvm.sh - Review and optimize resource allocation
- Test disaster recovery procedures
- Update documentation
- Review and update network configuration
- Perform security audit
Yearly Tasks
Yearly Tasks
- Plan and execute major version upgrades
- Review hardware health and consider replacements
- Audit user access and permissions
- Review and update security policies
- Archive old backups to long-term storage
Automation with Cron
Setup Automated Maintenance
Create a custom maintenance script:Best Practices
Before Maintenance
- Create backups
- Schedule during low-usage periods
- Notify users of planned maintenance
- Test in non-production first
During Maintenance
- Monitor logs in real-time
- Keep rollback plan ready
- Document any issues
- Take before/after snapshots
After Maintenance
- Verify all services running
- Check monitoring dashboards
- Review logs for errors
- Update maintenance documentation
Emergency Response
- Keep backup restoration tested
- Document rollback procedures
- Maintain emergency contact list
- Have offline documentation available
Regular maintenance prevents emergencies. Establish and follow a consistent maintenance schedule to keep your Proxmox environment healthy and reliable.