Prune Historical Monitoring Data
Command
Section titled “Command”php artisan uplinkr:pruneDescription
Section titled “Description”Combines various options for deleting existing data and files related to projects and results. This command helps manage storage by removing old probe results or completely wiping project data.
Options
Section titled “Options”| Option | Type | Required | Description |
|---|---|---|---|
--project | string | No | Optional project name to prune |
--before | string | No | Before date to prune files (e.g., 2024-01-01) |
--wipe-all | flag | No | Wipe all files from storage (requires configuration permission) |
--force | flag | No | Force execution without confirmation |
Usage Examples
Section titled “Usage Examples”Delete all data for a project
Section titled “Delete all data for a project”php artisan uplinkr:prune --project=my-projectDelete old probe results before a specific date
Section titled “Delete old probe results before a specific date”php artisan uplinkr:prune --project=my-project --before=2024-01-01Wipe all storage (dangerous!)
Section titled “Wipe all storage (dangerous!)”php artisan uplinkr:prune --wipe-allForce mode (skip confirmation)
Section titled “Force mode (skip confirmation)”php artisan uplinkr:prune --project=my-project --forceBehavior
Section titled “Behavior”Project-Specific Pruning
Section titled “Project-Specific Pruning”When --project is specified:
- Without
--before: Deletes the entire project directory - With
--before: Deletes only probe result files before the specified date
Complete Wipe
Section titled “Complete Wipe”When --wipe-all is specified:
- Requires
allow_complete_wipeto be enabled in configuration - Deletes the entire storage directory
- Recreates an empty storage directory
- Shows error if not allowed by configuration
Safety Features
Section titled “Safety Features”- Always prompts for confirmation (unless
--forceis used) - More aggressive confirmation for
--wipe-all - Validates date format for
--beforeoption - Shows count of deleted files when pruning by date
Use Cases
Section titled “Use Cases”- Storage Management: Remove old probe results to free up disk space
- GDPR Compliance: Delete data after retention period expires
- Project Cleanup: Remove projects that are no longer needed
- Testing/Development: Clear test data between runs
Return Codes
Section titled “Return Codes”0(SUCCESS): Pruning completed successfully1(INVALID): Validation failed or process was aborted2(FAILURE): Operation failed (e.g., invalid date format)
⚠️ Warning
Section titled “⚠️ Warning”This command permanently deletes data. Use with caution, especially with --wipe-all. Always ensure you have backups before pruning production data.