Hello.
First of all, it will depend on the environment the database is in.
If it is in a Windows, you can program a . bat and schedule its execution in the Task Scheduler. So you can determine what times it will run. And if it is on Linux, the output is to create a script and schedule its execution on crontab. Both the Windows Scheduler and Linux Crontab basically have the same functionality. If your intention is to use a language, python is very interesting and can suit you very well. But that’s up to you :)
Remembering that for both systems, Mysql has tools to dump.
Now leaving aside the issue of the script and the S.O., an important fact is that you should think very carefully about how you will develop this code. A cool example is you program two or three daily dumps, with "strategic" times, for example, one at the beginning of the day, another at noon and the last at the end of the day. In addition, it is important to keep these copies for a certain time. Ex: (i) save the last copy of the month of every month, (ii) the last copy of the week and (iii) the copies of every day of the week, erasing them only in the exchange of the week.
Finally, I see that despite the copies, something very important is to keep these copies replicated in another medium, be it an external hard drive, a network machine or an FTP server. Another fact, is to program a routine to validate if the copies are intact, and of course, to check if they are running, or if the file is being created (in linux may happen some problems with folder permission).
This is a subject that can yield much, little or no work, all depends on your concern with the security of your customer data! Start with something small, but always try to pay attention to it. Backup is only remembered when we need it.
See if this can help you https://sourceforge.net/projects/automysqlbackup/ or this https://www.noupe.com/development/10-ways-to-automatically-manually-backup-mysql-database.html
– Fernando Souza