Re: problem with exec
| From: | Richard Lynch | Date: | Sun, 21 Jul 2002 05:12:22 +0000 |
| Subject: | Re: problem with exec | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-108698@lists.php.net to get a copy of this message | ||
> exec("perl /usr/local/apache/htdocs/mlm/test/check1.pl &");
exec("..., $results, $errorcode);
echo implode("<BR>\n", $results);
if ($errorcode){
echo "OS Error $errorcode. Usually path/permissions. Use 'man erno' to
be sure");
}
>_____________________________
>
>#!/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");
The other poster is quite correct that it's kinda silly to fire up a shell
to fire up perl to fire up pg_dump.
You can at least cut out the Perl part. :-)
And, actually, you should probably be doing this as part of a cron job
rather than relying on frail humans to remember to click the button once in
awhile :-)
--
Like Music? http://l-i-e.com/artists.htm