Jump to content

Archived

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

natalieG

mysql backup script

Recommended Posts

we want to backup our database with a CRONTAB and need to geenrate the php script file. We don't
know the PHP configuration as to if it is stanfdalone or not, but we will sort that out
later. The filename will haver the date of backup in it. We have not tried the below scripot, but could
you take a quick look and tell us of this should work?
Thanks,

Jennifer

[b]<?php
$todaydate=date('m-d-Y');
$dbname=my database name;
$user = username
$password=mysql password
$filename='backup' . $todaydate .'.dmp' ;
$dumpstr="mysqldump $dbname -u $user -p $password > /home/msdsimg/backup/$filename";
shell($dumpstr);
?>[/b]

Share this post


Link to post
Share on other sites

×

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.