CRON Job to copy database and replace existing database

I have a reseller account with hostgator, which means i have WHM and Cpanel. I have set up a staging environment for one of my wordpress installations (client website), which is essentially sitting at staging.domain.com (live site is at domain.com). The staging website is a complete copy of the live website and utilises a different database.

The idea behind this is to test all new module updates / wordpress updates prior to releasing to the live website, however.. Content can chance on the live website without the staging website receiving the updates (want to use this as a backup also.)

What I want to do is set up a daily CRON job to copy the database from one hosting account to and replace another database. (tables and all) on a daily basis. I figure this will only be possible at host manager level (WHM) as a cpanel user will not have permission to interface between 2 different accounts.

Does anyone know how to do this? Do I need to create a PHP script to run every day? What would that look like.. Sorry I know its a big ask, im just clueless at this level.

Wouldn't it be easier to duplicate/replicate the database with database means?

I don't know which DB you use (probably mySQL), but all DB softwares i know of allow to create a complete dump of its contents. Create such a dump, transfer it to the staging-machine (simple file-transfer) and again use the DB mechanisms to update your DB there.

I hope this helps.

bakunin