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

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:

Target

Description

cache

Clears the server's application cache.

maintenance-status

Resets the server from a maintenance mode, often after a failed upgrade.

blacklist

Clears all entries from the router blocklist.

blacklist-expired

Clears 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

blocklet server cleanup cache

Upon successful execution, you will see a confirmation message:

Success Output

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

blocklet server cleanup maintenance-status

Upon success, the following message will be displayed:

Success Output

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

blocklet server cleanup blacklist

Successful execution will produce this output:

Success Output

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

blocklet server cleanup blacklist-expired

You will see the following confirmation on success:

Success Output

Expired router blocklist cleared