background process in perl cgi

like my command is

$cmd = perl ExomeSeqAMLpipeline.pl --input $tmpfilenameOne $tmpfilenameTwo --output $file_path

1)
    my $proc2 = Proc::Background->new("$cmd 1>&2");
    $proc1->alive;
    $proc1->die;
    $proc1->wait;
    my $time1 = $proc1->start_time;
    my $time2 = $proc1->end_time;

or

2)

my $pid = fork();
if (defined($pid) && $pid==0) {
    exec( "$cmd" );
    exit;
}

or

3)

system("$cmd &");

or

4)

exec("$cmd &");

or

5)

exec("$cmd --output $file_path > /dev/null 2>&1 &");



Comments

Popular posts from this blog