The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Cron Job

Discussion in 'General Discussion' started by HyperVirus, Jan 1, 2005.

  1. HyperVirus

    HyperVirus Registered

    Joined:
    Jan 1, 2005
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    Hello.

    i have a webspace account from a company.

    and i want to set up a cron job every min's or ever sec if thats possiable
    but i cannot seem to point it to the right dir for the file.

    on my ftp the file is located in /public_html/hlstats/hlstats.pl

    and for the cron job i have tryed many diffrent locations
    such as

    /home/gameres/public_html/hlstats/hlstats.pl
    /home/hlstats/hlstats.pl

    does anybody know where i could point it to find the file.

    Thanks for any help

    Kev
     
  2. PWSowner

    PWSowner Well-Known Member

    Joined:
    Nov 10, 2001
    Messages:
    2,948
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    ON, Canada
    Is that script written to be run as a cron job?

    Try putting:
    perl /home/gameres/public_html/hlstats/hlstats.pl
    as the command.
     
  3. HyperVirus

    HyperVirus Registered

    Joined:
    Jan 1, 2005
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    nope it didnt work :(

    it gave me

    Can't locate .//ConfigReaderSimple.pm in @INC (@INC contains: /usr/lib/perl5/5.8.4/i686-linux /usr/lib/perl5/5.8.4 /usr/lib/perl5/site_perl/5.8.4/i686-linux /usr/lib/perl5/site_perl/5.8.4 /usr/lib/perl5/site_perl/5.8.0 /usr/lib/perl5/site_perl .) at /home/gameres/public_html/hlstats/hlstats.pl line 50.

    um

    this is the link to the documentation what im following

    http://docs.unitedadmins.com/hlstats/en/

    Run hlstats.pl. It will by default run in the foreground (like HLDS) - to make it run in the background use something like:
    shell> ./hlstats.pl &
    HLstats is not required to run as root; running as an unprivileged user is recommened.

    Most shells will let you run a program in a loop, so that if it dies/crashes it will be automatically restarted. For example, you might want to try:
    shell> while true; do nohup ./hlstats.pl; sleep 5; done &
    (BASH Syntax) this line creates a loop, which appends any output from hlstats.pl into a file called nohup.out. If, for some reason hlstats.pl crashes, your server will wait 5 seconds, then restart hlstats.pl.


    but it tells to run as a background command and i have been told a cron job does this so i dont see the problem

    any ideas ??

    Kev
     
  4. HyperVirus

    HyperVirus Registered

    Joined:
    Jan 1, 2005
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    ive edit that .pl file so it has the right links in the files

    and now it says

    Can't locate http://www.game-resource.co.uk/hlstats/ConfigReaderSimple.pm in @INC (@INC contains: /usr/lib/perl5/5.8.4/i686-linux /usr/lib/perl5/5.8.4 /usr/lib/perl5/site_perl/5.8.4/i686-linux /usr/lib/perl5/site_perl/5.8.4 /usr/lib/perl5/site_perl/5.8.0 /usr/lib/perl5/site_perl .) at /home/gameres/public_html/hlstats/hlstats.pl line 50.


    it says it cannon locate but the file is there

    any ideas ??

    and it is possiable to set it to run all the time ?
     
  5. PWSowner

    PWSowner Well-Known Member

    Joined:
    Nov 10, 2001
    Messages:
    2,948
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    ON, Canada
    Sounds like a problem with the setup. For the cron job it should just be
    /home/gameres/public_html/hlstats/hlstats.pl
    but a cron job won't work if the script isn't working.



    For the path to the module, you don't use a URL, but the path on the server, like:
    /home/gameres/public_html/hlstats/ConfigReaderSimple.pm
     
Loading...

Share This Page