Skip to content

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:

  1. Navigate to your server in FlashPanel
  2. Go to the Utilities section on the server overview page
  3. Click on "Cleanup System"
  4. Review the description of what will be cleaned
  5. (Optional) Enable "Schedule this cleanup" for automatic future cleanups
  6. 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:

  1. Open the Cleanup System utility
  2. Check the "Enable Schedule" checkbox
  3. 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
  4. Or enter a custom cron expression for specific timing
  5. 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:

  1. Go to Scheduler in the server menu
  2. Look for system cleanup tasks
  3. Review the cron expression and last run time

Modifying the Schedule

To change the cleanup schedule:

  1. Open Cleanup System utility again
  2. Adjust the cron expression
  3. Click Execute to update

Disabling Scheduled Cleanup

To stop automatic cleanups:

  1. Open Cleanup System utility
  2. Uncheck "Enable Schedule"
  3. 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.