title: PHP MySQL database backup cron job
body: <p>I wanted to have database backup cron in webserver, I use following codes to output sql file:</p>
  
  <pre><code>&lt;?php
  include('connectdb.php');
  
  $backupFile = 'database_backup_'.date("YmdHis").'.sql';
  $command = 'mysqldump $dbname --password=$dbpass --user=$dbuser --single-transaction &gt;'.$backupFile;
  system($command);
  
  include('closedb.php');
  ?&gt;
  </code></pre>
  
  <p>but when I open the specific sql file, its only show text like this:</p>
  
  <pre><code>Usage: mysqldump [OPTIONS] database [tables]
  OR     mysqldump [OPTIONS] --databases [OPTIONS] DB1 [DB2 DB3...]
  OR     mysqldump [OPTIONS] --all-databases [OPTIONS]
  For more options, use mysqldump --help
  </code></pre>
  
  <p>What's wrong with my code?</p>
  
  <p>Thanks.</p>