Skip to main content
Version: 2.4.7

clean Command

The clean command marks resources for cleaning by setting desired.clean=true to the resources. Resources marked as such will be removed during the next cleanup step of the collect_and_cleanup workflow. See concept of workflows for reference.

Note: it is also possible to mark resources as protected, so they will never be cleaned up. See protect for more information.

The clean command expects query results (objects) or an array of object IDs to be piped as input. Optionally, you can provide a reason for marking the matched resources to be pruned during the next cleanup run. The reason is logged and can be useful in reviewing why a particular resource was deleted.

Usage​

clean <reason>

Parameters​

ParameterDescriptionRequired?Default Value
reasonReason for marking to be cleaned❌N/A

Examples​

Mark volumes that have not been accessed in the last month for cleanup, and list the ID and desired section for each
> search is(volume) and last_access>1month | clean "Volume not accessed for longer than 1 month" | list id, /desired
​id=vol-123, clean=true
Manually mark specific resources for cleanup
> json ["vol-123"] | clean | list id, /desired
​id=vol-123, clean=true
Mark all unused EBS volume older than 30 days that had no I/O during the past 7 days for cleaning
> search is(volume) and ctime < -30d and atime < -7d and mtime < -7d and volume_status = available | clean "older than 30d with more then 7d of not beeing used"