Skip to main content

Cleanup Server

The blocklet server cleanup command is a utility tool for performing various server-level maintenance tasks. It helps you resolve issues by clearing caches, resetting states, or managing network configurations without needing to stop the entire server.

Usage

The basic syntax for the command is:

Basic Syntax

bash
blocklet server cleanup <target>

Where <target> is the specific cleanup task you want to perform.

Available Targets

Here is a summary of the available cleanup targets:

TargetDescription
cacheClears the server's application cache.
maintenance-statusResets the server from a maintenance mode, often after a failed upgrade.
blacklistClears all entries from the router blocklist.
blacklist-expiredClears only the expired entries from the router blocklist.

Clear Server Cache

This target clears the server's application cache. This can be useful if you suspect outdated or corrupted data is causing issues with your server's operation.

Clear Cache Command

bash
blocklet server cleanup cache

Upon successful execution, you will see a confirmation message:

Success Output

bash
Cache for server cleared: [list of cleared cache keys]

Reset Maintenance Status

If your server gets stuck in a maintenance mode (e.g., after a failed or interrupted upgrade), this command will reset its status. It clears the upgradeSessionId and restores the server's previous operational mode, allowing it to function normally again.

Reset Status Command

bash
blocklet server cleanup maintenance-status

Upon success, the following message will be displayed:

Success Output

bash
Server maintenance status reset

Clear Router Blocklist

This command completely clears the server's router blocklist, which is used to temporarily block problematic routes or IPs. After clearing the list, the server's routing rules are immediately re-evaluated.

Clear Blocklist Command

bash
blocklet server cleanup blacklist

Successful execution will produce this output:

Success Output

bash
All router blocklist cleared

Clear Expired Router Blocklist

Unlike clearing the entire blocklist, this target specifically removes only the entries that have passed their expiration time. This is a less disruptive way to clean up the blocklist while keeping active blocks in place.

Clear Expired Blocklist Command

bash
blocklet server cleanup blacklist-expired

You will see the following confirmation on success:

Success Output

bash
Expired router blocklist cleared