Jump to content

Running function within script if it's been 30days since last execution..


cgm225

Recommended Posts

I want to have a simple php function for backing up my MySQL database monthly.  I have a function to backup the database (example below), but wanted to know if someone would help me with getting it to repeat monthly?

 

<?php

BackupDB () {
    $backupFile = date("Y-m-d-H-i-s") . '.sql';
    system("mysqldump --user=username --password=password --host=mysql.internal --databases myDB username_email > /web/mysite.com/BACKUP/mysql/$backupFile");
}

?>

 

Thank you all in advance!

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.