Jump to content

Toot4fun

New Members
  • Posts

    3
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Toot4fun's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Good morning! I was wondering, would be possible to run a command such as a verbose tar operation using exec() and have the stdout returned to the calling PHP page in a real-time fashion? Maybe using AJAX? If so, can anyone get me started? Thanks!!
  2. If it wasn't for the fact that $strCommand = "mysqldump --host=$strHostName --user=$strUserName --password=$strPassword $strDBName | gzip > $strBackupFile"; $strOutput = system($strCommand, $intReturnValue); dumps and zips the output, I would agree with you. But if I run the same command using system() as shown above, I end up with a gzip file. The problem is that if I force an error (bad password), the error is written directly to the screen - $strOutput is empty and $intReturnValue is equal to 0.
  3. I'm trying to create a PHP script that will use mysqldump to backup my databases. I have the following code: $strCommand = "mysqldump --host=$strHostName --user=$strUserName --password=$strPassword $strDBName | gzip > $strBackupFile"; $strOutput = exec(escapeshellcmd($strCommand) . " 2>&1",$arrOutput,$intReturnValue); if($intReturnValue != 0){ etc... However, I get an error that says "mysqldump: Couldn't find table: "|"". I have to assume it's because of the escaping (\), but if I run it without the escapeshellcmd(), if I have an error, the error is written directly to the screen, not stored in $arrOutput or $intReturnValue. If I use escapeshellcmd(), $intReturnValue is populated as is my output array $arrOutput. What gives?? Hopefully I have supplied enough information. Thanks!!
×
×
  • 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.