Best way to delete data

Hello everyone, I need to create a routine to delete data in a specific period.
What is the best way to do this? Is it possible to do it with Tasks?
Is there another way without using the bucket retention date?

Hello @andreia_pavan,
It depends what version are you using? Just want to verify. If it’s 2.x
I recommend using the CLI.
You’ll first have to install it and set up a CLI config.

Example of delteing all metrics within a time range:

Hello @Anaisdg, thank you for your answer.
I’m using version 2.x. Would it be possible to schedule within the Influx, as a task to schedule this delete execution?