Go Back   HostGator Peer Support Forums > Public Forums > Pre-Sales Questions

Notices

Reply
 
Thread Tools
  #1  
Old 09-13-2007, 04:47 AM
chrisjc chrisjc is offline
Hatchling Croc
 
Join Date: Sep 2007
Posts: 2
Default Cron job Perl Script

I'm trying to get a perl script to run in the cron job to create / update a file every minute at present. The file runs ok when i just access it from a browser and creates the file however when i put it in the cron job it doesn't create a file. Does anyone know why? My cron job and file are below:

* * * * * /usr/bin/perl /home/chrisjc/public_html/auto.pl


#!/usr/bin/perl
use Fcntl; #The Module

print "content-type: text/html \n\n"; #The header
sysopen (HTML, 'myhtml.html', O_RDWR|O_CREAT, 0755) or die "No way hoe say!";
printf HTML "<html>\n";
printf HTML "<head>\n";
printf HTML "<title>My Home Page</title>";
printf HTML "</head>\n";
printf HTML "<body>\n";
printf HTML "<p align='center'>Here we have an HTML
page with a paragraph.</p>";
printf HTML "</body>\n";
printf HTML "</html>\n";
close (HTML);
print "END";
Reply With Quote
  #2  
Old 09-13-2007, 05:05 AM
chrisjc chrisjc is offline
Hatchling Croc
 
Join Date: Sep 2007
Posts: 2
Default Re: Cron job Perl Script

Fixed...stoopid me!
Reply With Quote
  #3  
Old 09-13-2007, 05:11 AM
gtgeorge's Avatar
gtgeorge gtgeorge is offline
Emperor Croc
 
Join Date: Mar 2005
Posts: 2,258
Default Re: Cron job Perl Script

If you are on anything less than a dedicated server it would be advised to adjust your cron job to a much higher level if you haven't already done so HG's terms of service doesn't allow you to run a cron more often than every 15 min.
__________________
best regards,
George
Reply With Quote
Reply

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

All times are GMT -6. The time now is 08:36 PM.

 
Forum SEO by Zoints