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.
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.
|Reason for marking to be cleaned||❌||N/A|
> search is(volume) and last_access>1month | clean "Volume not accessed for longer than 1 month" | list id, /desired
> json ["vol-123"] | clean | list id, /desired
> 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"