Jump to content

[SOLVED] mysql table backup


pcw

Recommended Posts

Hi, I am having a prob with this script. It is creating the backup file, but is not writing the contents of the table into it.

 

 

include_once("data/required.php");

$date = date("d-m-Y");
$backupFile = "$date-profiles.sql";

$backupDir  = "/home/moveitho/public_html/sitebuilder/backup/"; 

$conn = mysql_connect($dbhost, $dbuser, $dbpass) or die(mysql_error()); 

$back = $backupDir.$backupFile; 
$strCommand = sprintf("mysqldump moveitho_sitebuilder profiles -h%s -u%s -p%s > %s",$host,$user,$pass,$back) or die (mysql_error()); 

echo shell_exec($strCommand); 
echo "Backup file $backupFile has been created successfully";
echo "This file has been saved in $backupDir";

 

This was working yeaterday, but I think I might have accidently changed something.

Link to comment
Share on other sites

could it be this

 

mysqldump moveitho_sitebuilder profiles -h%s -u%s -p%s > %s

 

it says "moveitho" should that be "moveito"

 

Sorry if I'm being completely idiotic, I'm not familiar with shellexec(), it just struck me as looking a bit like a typo.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.