Community Forums

Important Notice:

Two sections of this forum are available only to registered customers. In order to receive access to the Customer Forums and ResellerCentral Forums, you must first register on these forums or login to your existing forum account. If you are an existing HostNine customer, be sure to register using the email address on file for your billing profile.

Go Back   HostNine Community Forums > H9 Customer Forums > Dedicated Servers

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 12-14-2007, 12:07 PM
lazysheepmedia lazysheepmedia is offline
Newbie
 
Join Date: Dec 2007
Location: United Kingdom (Beds)
Posts: 17
Send a message via MSN to lazysheepmedia Send a message via Skype™ to lazysheepmedia
Default Cron jobs

Guys

I have set a cron up and it does not seem to work. i get this message when it si run

Quote:
/bin/sh: http://www.lazysheepmedia.com/uptime/check5min.php: No such file or directory
I have also tried it as absolute path and I get the error

Quote:
/home/lazyshee/public_html/uptime/check2min.php: line 1: ?: No such file or directory
/home/lazyshee/public_html/uptime/check2min.php: line 2: syntax error near unexpected token `0'
/home/lazyshee/public_html/uptime/check2min.php: line 2: ` error_reporting(0);'
Any help appreciated

Regards

Mark
Reply With Quote
  #2  
Old 12-14-2007, 03:37 PM
jimbug jimbug is offline
Newbie
 
Join Date: Oct 2007
Location: California, USA
Posts: 18
Default

Quote:
Originally Posted by lazysheepmedia View Post
Guys

I have set a cron up and it does not seem to work. i get this message when it si run

I have also tried it as absolute path and I get the error

Mark

You are asking bash to execute PHP.

Usually you run PHP this way from cron...
* * * * * php -q /home/lazyshee/public_html/uptime/check2min.php

sometimes...
* * * * * wget http://www.lazysheepmedia.com/uptime/check5min.php


Remember to set...
MAILTO=""
... to where any output is mailed to or add...
>/dev/null 2>&1
... to the end of the script to suppress any output.
Reply With Quote
  #3  
Old 12-14-2007, 03:53 PM
jimbug jimbug is offline
Newbie
 
Join Date: Oct 2007
Location: California, USA
Posts: 18
Default

A few years ago I wrote a couple of shell scripts that monitor uptime and load average. The load average one emails you, with the current uptime and a ps list, if the load average gets above a certain level and the uptime one saves the uptime to a text file on the server. If there was a reboot since last check, it saves a line with the reboot time and the total uptime of last boot, also.

PM me if you want me to email them to you.

I run them every 15 minutes. They have little impact on the server.

Sample uptime...
Server rebooted: [ Wed Sep 5 01:51:02 PDT 2007 ] Last uptime: .65 days
06:07:01 up 42 days, 4:16, 2 users, load average: 0.52, 0.48, 0.59 [ Wed Oct 17 06:07:02 PDT 2007 ]
Server rebooted: [ Wed Oct 17 11:21:04 PDT 2007 ] Last uptime: 42.39 days
12:07:01 up 9 days, 19:55, 2 users, load average: 0.12, 0.34, 0.24 [ Sat Oct 27 12:07:02 PDT 2007 ]
Server rebooted: [ Sat Oct 27 16:53:02 PDT 2007 ] Last uptime: 10.02 days
00:07:02 up 29 days, 8:15, 0 users, load average: 4.20, 2.89, 2.29 [ Mon Nov 26 00:07:06 PST 2007 ]
Server rebooted: [ Mon Nov 26 00:24:04 PST 2007 ] Last uptime: 29.35 days
12:07:01 up 18 days, 11:43, 0 users, load average: 0.35, 1.04, 1.41 [ Fri Dec 14 12:07:03 PST 2007 ]

Last edited by jimbug; 12-14-2007 at 03:58 PM.
Reply With Quote
  #4  
Old 12-14-2007, 04:01 PM
lazysheepmedia lazysheepmedia is offline
Newbie
 
Join Date: Dec 2007
Location: United Kingdom (Beds)
Posts: 17
Send a message via MSN to lazysheepmedia Send a message via Skype™ to lazysheepmedia
Default

Hi Jim

I have tried both and it returns the same error in ssh

Quote:
-bash: anaconda-ks.cfg: command not found
I have tried both versions to no avail

Thanks

Mark
Reply With Quote
  #5  
Old 12-14-2007, 04:19 PM
jimbug jimbug is offline
Newbie
 
Join Date: Oct 2007
Location: California, USA
Posts: 18
Default

Hi Mark,

I know nothing about your server or the PHP script you're running. Apparently it's executing some shell commands. I try to run only shell scripts from cron. I think shell scripts have a lower impact on the server. I would suggest you debug the PHP script before running it with cron. And maybe rewrite it as a shell script.

I don't know much more to say.
Reply With Quote
  #6  
Old 12-14-2007, 04:25 PM
lazysheepmedia lazysheepmedia is offline
Newbie
 
Join Date: Dec 2007
Location: United Kingdom (Beds)
Posts: 17
Send a message via MSN to lazysheepmedia Send a message via Skype™ to lazysheepmedia
Default

Thanks Jim

I think it is back to the drawing board to fix it

Thanks for your time

Kind regards

Mark
Reply With Quote
Reply

Thread Tools
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
node42 Cron BlueOx Reseller Hosting 6 07-07-2008 03:37 PM
Suspension Due to corn jobs!!! eindia7 Reseller Hosting 2 04-17-2008 10:55 AM


All times are GMT -5. The time now is 09:29 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.

Host Nine

Our mission began in 2006. Thousands of awesome clients later, we are now one of the most popular hosters in the world.
Most of this is because of our fantastic support. Join us, you'll be glad you did - that's a given.