Cleanup System
Overview
The Cleanup System utility in FlashPanel
is a comprehensive maintenance tool designed to optimize server performance by removing unnecessary files, clearing caches, and managing disk space efficiently. It helps prevent disk space issues and keeps your server running smoothly.
What is System Cleanup?
Over time, servers accumulate temporary files, logs, and cached data that consume valuable disk space. While these files serve purposes during operation, they often become outdated or unnecessary. System Cleanup automatically identifies and removes these files while preserving important data and system functionality.
What Gets Cleaned
The Cleanup System removes unnecessary files while preserving important data:
- System and Application Logs: Old log files, compressed archives, and rotated logs
- Package Cache: Downloaded packages, cached metadata, and orphaned dependencies
- Application Caches: Temporary files, session data, and runtime caches (PHP OPcache, etc.)
- System Journal: Old systemd journal entries and rotated journal files
When to Use Cleanup System
Use System Cleanup when you:
- Need to free up disk space quickly
- Experience low disk space warnings
- Want to maintain optimal server performance
- Need to remove accumulated temporary files
- Are preparing for a major update or installation
- Want to establish a regular maintenance routine
Using Cleanup System
Manual Cleanup
To run a one-time cleanup:
- Navigate to your server in
FlashPanel
- Go to the Utilities section on the server overview page
- Click on "Cleanup System"
- Review the description of what will be cleaned
- (Optional) Enable "Schedule this cleanup" for automatic future cleanups
- Click Execute to start the cleanup
The cleanup typically completes within 1-3 minutes depending on server size and accumulated files.
Scheduled Cleanup
For automated maintenance, you can schedule the cleanup to run periodically:
- Open the Cleanup System utility
- Check the "Enable Schedule" checkbox
- Choose a schedule interval:
- Every Minute (
* * * * *
) - For testing only - Hourly (
0 * * * *
) - For high-traffic servers - Nightly (
0 0 * * *
) - Recommended for most servers - Weekly (
0 0 * * 0
) - For low-activity servers
- Every Minute (
- Or enter a custom cron expression for specific timing
- Click Execute to save the schedule and run the initial cleanup
Best Schedule
We recommend running cleanup nightly at midnight (0 0 * * *
) for most servers. This timing:
- Minimizes impact on users
- Provides daily maintenance
- Prevents disk space issues before they occur
- Runs during low-traffic hours
Custom Cron Expressions
For more control over scheduling, you can enter custom cron expressions. Learn more about cron expressions in our Cron Job Guide.
Scheduling Management
Viewing Current Schedule
To see if cleanup is scheduled:
- Go to Scheduler in the server menu
- Look for system cleanup tasks
- Review the cron expression and last run time
Modifying the Schedule
To change the cleanup schedule:
- Open Cleanup System utility again
- Adjust the cron expression
- Click Execute to update
Disabling Scheduled Cleanup
To stop automatic cleanups:
- Open Cleanup System utility
- Uncheck "Enable Schedule"
- Click Execute to remove the schedule
Event Logging
All cleanup operations are logged as events:
- Event Description: "Cleanup System"
- Execution Time: Typically 1-3 minutes
- Output: Detailed log of operations and space recovered
- Schedule Info: If cleanup was triggered by schedule
Review event logs to:
- Track cleanup history
- Verify space recovery
- Troubleshoot issues
- Monitor cleanup frequency
Performance Impact
System Cleanup has minimal performance impact:
- During Cleanup: Slight CPU and I/O usage (1-3 minutes)
- Disk Impact: Reduces disk usage, improving performance
- No Downtime: Servers remain online and accessible
- Safe Timing: Schedule during low-traffic hours for best results
Pro Tip
Set up nightly cleanup and forget about disk space management. The automated cleanup will keep your server optimized without any manual intervention.