Trigger to autodelete oldest entries to maintain a state of 90% disk space used

My current approach is this:

function daysToMillis(days) {
  return days * 24 * 3600 * 1000
}

exports = async function() {
  const cleanUpTime = Date.now() - daysToMillis(60);
  const files = await context.services.get("unciv").db('unciv').collection('UncivServer');
  const res = await files.deleteMany({ timestamp: { $lt: cleanUpTime } });
  console.log(`${res.deletedCount} documents deleted`);
  return res;
};

But I dont want to solely rely on the timestamp. I want to disk used as parameter. How can I do that?