Skip to content

Prune Historical Monitoring Data

Terminal window
php artisan uplinkr:prune

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.

OptionTypeRequiredDescription
--projectstringNoOptional project name to prune
--beforestringNoBefore date to prune files (e.g., 2024-01-01)
--wipe-allflagNoWipe all files from storage (requires configuration permission)
--forceflagNoForce execution without confirmation
Terminal window
php artisan uplinkr:prune --project=my-project

Delete old probe results before a specific date

Section titled “Delete old probe results before a specific date”
Terminal window
php artisan uplinkr:prune --project=my-project --before=2024-01-01
Terminal window
php artisan uplinkr:prune --wipe-all
Terminal window
php artisan uplinkr:prune --project=my-project --force

When --project is specified:

  • Without --before: Deletes the entire project directory
  • With --before: Deletes only probe result files before the specified date

When --wipe-all is specified:

  • Requires allow_complete_wipe to be enabled in configuration
  • Deletes the entire storage directory
  • Recreates an empty storage directory
  • Shows error if not allowed by configuration
  • Always prompts for confirmation (unless --force is used)
  • More aggressive confirmation for --wipe-all
  • Validates date format for --before option
  • Shows count of deleted files when pruning by date
  • 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
  • 0 (SUCCESS): Pruning completed successfully
  • 1 (INVALID): Validation failed or process was aborted
  • 2 (FAILURE): Operation failed (e.g., invalid date format)

This command permanently deletes data. Use with caution, especially with --wipe-all. Always ensure you have backups before pruning production data.