Wordpress TMP Full

Hello,

Almost every day I get this type of error:

WordPress database error Disk full (/tmp/#sql_2bf_0.MAI); waiting for someone to free some space... 

How can I create a cron job to clean the /tmp/ daily?
This is super frustating.

Clean the tmp directory using
rm -rf /tmp/*
after running this must reboot server once

Hey,
I already do this, but I want to automatize. It’s possible?

Change MySQL temp path as database server creating temp files there and it’s small in size.

Check this and follow my suggestions to see if this helps. This is what works for me.
https://community.cyberpanel.net/t/how-to-solve-tmp-100-usage/36824/4?u=quoviz_dev

Read through the thread for my comments.

I get the same error on my websites. Which is the best practice to solve this issue?

Will the cronjob solve the problem?
And how often must this task run?
What could happen if I delete a tmp file which is being used right in the moment I am deleting iT?

It is so frustrating, because all the websites hosted in Cyberpanel become inaccessible when this happen.