Hi friends
I have created a file to make the DB Backups. I have run it through the browser and its running fine. But when I run it through the cron then it starts giving error.
The script is basically,
The error i recieve in the cron email repeatedly isPHP Code:$today = date('Y-m-d');
mkdir('./db_backups/'.$today, 0777);
$sql = "select hostname, dbname, username, pass from xxxxxx";
$rs = $DBConn->query($sql);
while($objPartner = $DBConn->fetchNextObject($rs))
{
set_time_limit(500);
// Enter Database access details
$host= $objPartner->hostname;
$user= $objPartner->username;
$pass= $objPartner->pass;
$db= $objPartner->dbname;
// Instructing the system to zip and store the database
system(sprintf(
'mysqldump --opt -h%s -u%s -p%s %s | gzip > ./db_backups/%s/%s.sql.gz',
$host,
$user,
$pass,
$db,
$today,
$db
));
echo '+DONE';
}
I have tried to look up the errno 32 and its about Broken pipe.Code:sh: /db_backups/2008-11-19/xxxxx.sql.gz: No such file or directory mysqldump: Got errno 32 on write +DONE
Which is kind of crazy as I have put all the permissions right. I have put the full rwx writes on the cron script as well db_backups has a 777 right.
Please help me out
Regards





Bookmarks