Asset Storage Deletion

Overview

The Delete Storage-Items command is an automated background process that removes orphan files (storage items) from the file system. These are files that no longer have a corresponding asset or asset version in the Censhare database. For example, the asset or version was permanently deleted by a user, by Asset Deletion 3 (AD3).

Key characteristics:

  • Enabled by default: No configuration required. It starts working immediately.

  • Runs independently: It does not depend on that Asset Deletion 3 (AD3) is enabled.

  • Distributed execution: It runs on all servers: master and remote instances with local file systems).

  • Scheduled automatically: It executes every 4 hours on a fixed schedule.

  • Timeout protected: It has a maximum execution time of 60 minutes.

Why this matters

When assets are permanently deleted from the system, their associated files may remain on disk when they are not removed. Over time, this can cause:

  • Storage volumes to fill up

  • Disk space waste

  • Performance degradation

  • Backup overhead

The Delete Storage-Items Server command ensures that orphan files are automatically cleaned up. This frees up storage space without that administrator intervention is required.

How it works

The storage deletion queue

When an asset or version is permanently deleted (either by AD3 or by other deletion processes), the system stores a record of its storage items. This is saved at a special database table called the storage deletion queue. This queue serves as a staging area for files that should be deleted.

The deletion process

The Delete Storage-Items command executes the following steps:

  1. Check the queue: It reads all pending entries from the storage deletion queue table.

  2. Verify file usage: For each queued file, it checks whether any asset or asset version in the system still uses that file. This is necessary because multiple assets can reference the same file, for example after creating a duplicate.

    • If the file is still in use: It removes the entry from the queue without deleting the file.

    • If the file is not referenced by any asset: It marks it for deletion.

  3. Delete the file: It removes truly orphan files from the storage file,. Orphan files are not referenced by any asset in the system.

  4. Clear the queue entry: It removes the record from the deletion queue after successful deletion.

  5. Log actions: It records all deletions in the application log for audit purposes.

Distributed execution

The command must run on master and all remote server instances. Remote servers must be included because they may have local asset volumes which are not accessible from the master server. Since the master server cannot access these local file systems, each server must clean up its own orphan files.

Scheduling

The Delete Storage-Items command runs automatically on the following schedule:

Parameter

Value

Frequency

Every 4 hours

Scheduled times

00:13, 04:13, 08:13, 12:13, 16:13, 20:13 (13 minutes past the hour)

Timeout

60 minutes per execution

Execution scope

All servers (master and remote) with local file systems

Note: The execution times are offset from the hour (at 13 minutes) to distribute system load and avoid conflicts with other scheduled tasks.

Configuration

The Delete Storage-Items command requires no configuration.

It is enabled by default and uses built-in settings that are appropriate for all systems.

What you cannot configure

  • Execution schedule: always runs every 4 hours at fixed times

  • Timeout: always 60 minutes

  • Storage item selection: All orphan items are cleaned up. There is no filtering is available.

  • Behavior options — No options available; the command always operates the same way

What you should know

  • No admin dialog: There is no configuration dialog in the Censhare Admin Client for this command.

  • No enable/disable switch: The command is always enabled. You cannot disable it.

  • No impact on AD3: This command operates independently and does not interfere with Asset Deletion 3 settings.

Interaction with Asset Deletion 3 (AD3)

Independence

The Delete Storage-Items command is completely independent from Asset Deletion 3:

  • AD3 disabled: Storage items are still cleaned up by this command.

  • AD3 enabled: Storage items are cleaned up by this command (not by AD3).

  • AD3 configuration changed: This has no impact on storage item deletion. It continues running normally.

Complementary roles

  • AD3 marks and permanently deletes asset versions and entire assets according to configured retention policies.

  • Delete Storage-Items: The service removes orphan files from storage whose assets or asset versions have been deleted.

Together, these ensure that:

  1. Outdated assets and versions are removed (AD3 responsibility).

  2. Their orphan files are cleaned from disk (Storage deletion responsibility).

  3. Storage space is always reclaimed.

In earlier versions (before 2026.1), storage cleanup was part of AD3 and required two separate conditions to be met:

  1. AD3 had to be enabled: AD3 was disabled by default.

  2. "Delete storage items" checkbox had to be enabled: Even if AD3 was enabled, an additional Delete storage items option in the AD3 configuration dialog had to be explicitly checked. The default state was off.

This meant that file cleanup required deliberate admin action on two separate fronts.

With the separation in 2026.1.0, storage is always cleaned up automatically every 4 hours, regardless of AD3 status or configuration.


Monitoring

Server logs

The Delete Storage-Items command logs its activity to the application logs. The command looks for entries with the module name "Delete Storage-Items".

Example log entries:

[INFO] Storage Item Deletion has started
[INFO] Waiting 47 second(s) before deletion (random delay)
[INFO] Finished waiting, starting deletion now
[INFO] Storage Item Deletion has finished; 1234 unused files deleted

What the logs tell you

Entry

Comment

Storage Item Deletion has started

The scheduled run has begun.

Waiting X second(s) before deletion

The random delay is active (expected behavior).

X unused files deleted

How many orphan files were removed during this run.

Error entries

If something went wrong, for example file system access issues, or corrupt queue entries.

Expected Behavior

  • Runs every 4 hours: You should see one execution per 4-hour period.

  • Variable file count: The number of deleted files varies depending on deletion activity in your system (0 to thousands).

  • Consistent timing: Executions occur at predictable times: 00:13, 04:13, etc.

Troubleshooting

No Action Required

If the command is running regularly and logging "X files deleted" over time, the system is working correctly.

No log entries for "Delete Storage-Items"

Possible Causes:

  1. Log level too high: Application logging is set to WARN or ERROR. INFO messages are filtered out.

  2. Logs are archived/rotated: Recent entries may have been deleted.

  3. Command is not running: Unlikely, but could indicate a server startup issue.

How to Check:

  • Verify the current log level in your application configuration.

  • Check if the application has been running for at least 4 hours in order to see at least one scheduled execution.

  • Look at logs from different times of the day: The command runs at 00:13, 04:13, 08:13, etc.

How to Fix:

  • Lower the log level to INFO to see more detailed messages.

  • Check the most recent log files. Rotation may move old entries to separate files.

Storage deletion queue has entries but files are not deleted

Possible causes:

  1. File system access issue: The system cannot read or write to the storage location.

  2. Disk full: Storage volume is full. This prevents file operations.

  3. Permission issue: The Censhare Server process lacks permission to delete files.

  4. Corrupted queue entry: A malformed entry prevents processing of subsequent items.

How to Check:

  • Verify that the storage file system is accessible and mounted.

  • Check for disk free space on all storage volumes.

  • Review server logs for error messages, for example permission denied, I/O errors, etc.

  • Inspect the storage_deletion_queue table for unusual entries.

How to Fix:

  • Ensure the storage location is writable by the Censhare Server process.

  • Free up disk space if volumes are full.

  • Correct file system permissions. Consult your system administrator if required.

  • Contact Censhare support if queue entries are corrupted: they can help you to clean up the queue table.

Command runs but deletes 0 files

Possible Causes:

  1. Normal operation: No assets have been deleted recently: There are no orphan files.

  2. Queue is empty: All previously orphan files have already been cleaned up.

  3. Files already missing: Orphan files were manually deleted from disk: Queue entries refer non-existent files.

How to Check:

  • This is typically normal behavior: The command will log "0 files deleted" if there is nothing to clean up.

  • Check whether assets or versions have been deleted in your system recently.

  • If the queue table has many entries but the command logs 0 deletions, there may be an access issue (see above).