Results 1 to 3 of 3

Thread: Use Perl as cron job / scheduled task

  1. #1

    Join Date
    Sep 2002
    Location
    Auckland
    Posts
    1,356
    Rep Power
    16

    Use Perl as cron job / scheduled task

    Hello.

    i've been using PHP as my main scheduled task, But I am looking to install a PERL script as a cronjob.

    1) at the start of PHP scrips, we use :-

    /usr/local/bin/php5-cli (path to php script).

    Can anyone advise the process / correct format to run/activate a Perl script.

    2) My basic problem, is that i want to extract data from a website, but my existing PHP scripts dont do this (the website uses Javascript - i think ?).

    The PHP script does extract the HTML, but its only half the HTML that i see in my browser.

    I assume LWP can get javascript websites - HTML ??

  2. #2

    Join Date
    Sep 2002
    Location
    Auckland
    Posts
    1,356
    Rep Power
    16
    Further.

    I've put the pl script in my cgi-bin directory. & i'm getting a server error.

    Internal Server Error

    The server encountered an internal error or misconfiguration and was unable to complete your request


    Code:
    #!/usr/bin/perl -w
    use CGI::Carp qw(fatalsToBrowser);
    use CGI 'param';
    use LWP::Simple;
    use strict;
    use warnings;
    
    
    my(@dir_contents)=();
    my($dir_to_open)="";
    
    		@dir_contents;
    		$dir_to_open="/home/users/USERDIRECTORY/cronjobs-perl/URL-in";
    print "DIR TO OPEN $dir_to_open\n";
    
    	exit 0;
    # sleep 21;
    Q. is the above script OK / correct ?

    Q. is there existing scrips to

    - do 'glob' on a directory for certain file names & pick 1 file.

    - open the file & get the URL& other ?
    (the file will have 1 line of data - data1,data2,URL )

    -get the HTML of the URL, (after any Javascript has been processed)

    - save HTMl to file

  3. #3
    Rick
    Join Date
    May 2002
    Location
    Minneapolis, MN
    Posts
    1,753
    Rep Power
    19
    That error message commonly means there's a permissions issue with the script file. Be sure to set the permissions to 0x755 on the file itself - either in your FTP program or using the File Manager here on Powweb.
    Rick Trethewey

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •