problem with exec
| From: | umesh | Date: | Sat, 20 Jul 2002 12:25:32 +0000 |
| Subject: | problem with exec | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-108656@lists.php.net to get a copy of this message | ||
Hi Gurus,
I am using PHP 4.1.1, Postgresql 7.2 and Perl 5.6.0 on Linux.
I want to execute a perl script throgh a PHP, which will take backup of the
database after submit button on the PHP is clicked.
But I am unable to do it, can anybody pls. help me. Following is the part of
code I am using,
PHP Code
_________________
if($_POST['btnSubmit'])
{
exec("perl /usr/local/apache/htdocs/mlm/test/check1.pl &");
}
Perl Script follows (check1.pl)
_____________________________
#!/usr/bin/perl -
use POSIX qw(strftime);
$Date=POSIX::strftime("%Y%m%d%H%M", localtime);
system("pg_dump -S postgres -f testUDdb
>/usr/local/apache/htdocs/mlm/admin/backup/".$Date."backup");
Thanking you in anticipation.
Regards
Umesh.
*****************************
Umesh A. Deshmukh.
Manas Solutions Pvt. Ltd.
umesh@manas-solutions.com
http://www.manas-solutions.com
Ph. : 91+020+4006358,4223991/92
*****************************