Mysqldump: got errno 32 when writing (shared host 1and1) as crontab

I am using the exact code that 1and1 offers for backing up MySQL databases via mysqldump (http://faq.1and1.co.uk/archive/43.html)

$host= 'xxxx';
$user= 'xxxx';
$pass= 'xxxx';
$db=   'xxxx';

system(sprintf(
  'mysqldump --opt -h%s -u%s -p%s %s | gzip > %s/backup/' . time() . '.sql.gz',
  $host,
  $user,
  $pass,
  $db,
  getenv('DOCUMENT_ROOT')
));

Changed all permissions to 777 for testing purposes. Not lucky yet. Continuing to receive an error (errno 32 when writing).

Any help is appreciated - this seems like a silly fix.

+3
source share
1 answer

cron, DOCUMENT_ROOT . DOCUMENT_ROOT $_SERVER - (. $_SERVER), ' script cron, -. . , .

PHP script. , script .../your_folder/scripts/backup_script.php, ( ) .../your_folder/backup/,

$backup_dir = dirname(__FILE__) . '/../backup';

... $backup_dir getenv('DOCUMENT_ROOT').

, , script -, .

+4

All Articles