38 users online (2 members and 36 guests)  


  Results 1 to 2 of 2

Related

  1. Help with my perl script    Forum: CGI Perl Forum
    Replies: 1
  2. Please Help me (Perl Script)    Forum: CGI Perl Forum
    Replies: 1
  1. #1
    paul.lkw's Avatar
    New User

    Status
    Offline
    Join Date
    Jul 2005
    Posts
    4

    Talking Perl Script cannot perform in cron job !

    I have a FreeBSD box running 4.11-p11 and writed a script to automatically generate web trafic report using webalizer; below is the script, I can run and get the result from the shell but not using the cron

    #! /usr/bin/perl -w

    $lscommand = "ls /var/log/httpd";
    @result = `$lscommand`;

    foreach (@result) {
    @domain_name = split /.log/, $_;
    $statistic_command = "webalizer -n $domain_name -qo /home/WWW/domain_name/html/statistic/ /var/log/httpd/$_";
    `$statistic_command`;
    }

    exit(0);


    What is (are) wrong with my code when using with cron job?

    THX a lot.

  2. #2
    ALL's Avatar
    Super Dooper Nerd

    Status
    Offline
    Join Date
    Feb 2005
    Location
    localhost
    Posts
    382

    Re: Perl Script cannot perform in cron job !

    do you get an error? (what is it)

    the only thing i might question is the way you are doing the for statment (might just be me due to moving back and forth from perl to php)... you are using $_ which is usually an array (but cant remember in that case).

    try having check points. do somthing like have it print a number each time it gets to a certain point.



Tags for this Thread