Dump data to a compressed file before RP drops it

Hi all,
is it possible to dump the data to a file before RP drops it?
For example:

  • I’ve a measurement “raw_data” defined on a RP of 1 month
  • What i want is that when the month is finished the data of 1 month is dumped to an external compressed file and then is dropped from the measurement.

Is that possible in Influx or i’ve to do it with an external application?

Thank you!