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] Quote Link to comment https://forums.phpfreaks.com/topic/12076-mysql-backup-script/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.