regex_replace in recording path on psql error

Status
Not open for further replies.

djacob

Member
Oct 31, 2016
43
8
8
51
Bensalem PA , USA
Hey all, been working on solution for my recordings folder getting to be enourmous in size. I asked the other week about adding NFS for recordings but mcrane suggested not the best idea as if its writing a recording and the nfs is not mounted it could crash the system. my solution is hoaxy but this will be temp. Im going to have a nfs mount on the system as /mnt/nfs, all recordings older than 24 hours will be moved there. then i will have a folder called /archive/recordings that will be a link to /mnt/nfs. I want to have a script run every night at 3am that will replace "/var/lib/freeswitch/recordings/domain_name/archive/2022/Oct/04" with "/archive/recordings/domain_name/archive/2022/Oct/04" for any cdrs for previous day. This will tell the system to use folder /archive/recordings to find the file from the cdrs screen. if the nfs mount goes offline, it will just be a empty folder and find no recordings since its just a link. and all new recordings are still written to the local drive in "/var/lib/freeswitch/recordings"

My problem is the following, when trying to run regex_replace in postgres. i get error "HINT: No function matches the given name and argument types. You might need to add explicit type casts." and i dont know how to fix it.

here is the sql for my test update v_xml_cdr set record_path= regex_replace(record_path, '/var/lib/freeswitch/recordings', '/storage/recordings', 'g') where xml_cdr_uuid='3b3adbf8-48ab-11ed-a4cc-65c696c3916d' , anyone know why its giving me this error, not s a psql guru. thanks
 
Status
Not open for further replies.