natalieG Posted June 15, 2006 Share Posted June 15, 2006 we want to backup our database with a CRONTAB and need to geenrate the php script file. We don'tknow the PHP configuration as to if it is stanfdalone or not, but we will sort that outlater. The filename will haver the date of backup in it. We have not tried the below scripot, but couldyou 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] Link to comment https://forums.phpfreaks.com/topic/12076-mysql-backup-script/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.