Report this

What is the reason for this report?

How to filter list command to get droplets older than X days?

Posted on August 4, 2022

I need to delete droplets that are older than 1day. When I do doctl compute droplet list It does not show my any info about age. How can I list and delete droplets that are older than 1 day?



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Hi there,

I don’t think that the created_at field is available via the doctl compute droplet list command. What you could do is open a feature request here to get that added as an option:

https://github.com/digitalocean/doctl/issues

In the meantime, I could suggest using the HTTP API which includes the created_at date:

https://docs.digitalocean.com/reference/api/api-reference/#operation/droplets_list

Hope that this helps!

Best,

Bobby

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Start building today

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.