Call recordings backup based on remaining disk space

We have a requirement to keep call recordings for a long time. Historically, I have just been offloading these call recordings to another server manually when the disk is filling up. But I would like to setup a script to to this automatically based on remaining disk space. Also, I would like to move them to an online storage provider (BackBlaze)

For example: When disk is 75% full, move the last week of call recordings to Backblaze. Then delete the source files that were just successfully transferred.

Would someone be able to provide a script/process for doing this?

No idea about backblaze’ api , but

[[ $(df  /|awk '{print $5}'|tail -1|tr -d '%') -ge 75  ]]&&find /var/spool/asterisk/monitor  -mtime +7

would identify the ‘culprit’ files

Awesome. Thank you dicko!