Page 1 of 1

exec() sometimes works sometimes not

Posted: Fri Jun 20, 2008 2:00 pm
by php_ghost

Code: Select all

 
exec("gunzip $filename");
exec("rm -f $filename");
 
Here are two lines of codes from my script. the second line is consistent. It successfully deletes the file contained in $filename meaning, exec works fine and $filename contains a valid filename. However the first line (one with gunzip) sometimes works sometimes it doesn't. Anyone encountered this weird problem? TIA

-archie

Re: exec() sometimes works sometimes not

Posted: Fri Jun 20, 2008 2:48 pm
by Christopher
What user creates the zip file? It is probably a permission problem.

Re: exec() sometimes works sometimes not

Posted: Fri Jun 20, 2008 3:46 pm
by php_ghost
arborint wrote:What user creates the zip file? It is probably a permission problem.
the zip file is created in the same script using this code:

Code: Select all

   exec("mysqldump --host=$db_host --user=$db_user --password=$db_pass $db_name | gzip -9  > $filename.sql.gz ");

Re: exec() sometimes works sometimes not

Posted: Wed Jun 25, 2008 4:25 pm
by php_ghost
up