Geekzone: technology news, blogs, forums
Guest
Welcome Guest.
You haven't logged in yet. If you don't have an account you can register now.


6 posts

Wannabe Geek


Topic # 87037 18-Jul-2011 14:19
Send private message

Hi everyone,

This post is a request for assistance; I have read the forum guidelines and believe this post doesn't violate any. I found Geekzone.co.nz through searching for help with Telecom NZ web hosting, and I have searched the forum for topics related to this problem, but have not found the topic posted previously.

I am curious as to whether anyone on here is familiar with Telecom's Unix Web Hosting, in particular if anybody has been able to set up a scheduled task (i.e. Cron task) successfully via the provided control panel software.

My first port of call was to ask their technical support for assistance, however they informed me they are not trained in the matter. I then asked if they could put me in touch with a technician who is familiar with the software, or the name or supplier of the software, so that I might contact them directly with my problem, but have not heard anything from them in over a week.

Information about the account:
-My client uses Telecom's 10GB Unix Hosting plan

Information about the cron task:


  • It's a php script that searches a database for unsent mail messages, and then schedules them to be sent.

  • It is meant to run every 5 minutes.

  • I have confirmed the script does work as expected when you load it through a web browser.

  • You can access the script through http, it is below the document root.



So, what I have done is added a command to the scheduled tasks, set the "task time" to "every five", and set the command itself to "/usr/bin/wget /usr/www/htdocs/360pm/mailscan.php >/dev/null" and have tried a few variations of this, but to no avail.

Can anybody spot what I've done wrong?

I do have a couple of suspicions:

  1. We don't actually have a /usr/bin/wget directory on the the account, and as it's a shared hosting service, is there a common directory that wget is accessible from on the server?

  2. Would the command need the absolute file path (i.e. starting from the drive letter) or is it sufficient to start it from "usr" - and is "usr" sufficient or should I put in the actual username?

Anyway, I would be absolutely delighted if there's someone here with a bit of insight on this who could enlighten me.

Happy to provide you with additional information if needed.

Thanks in advance :)

Create new topic
584 posts

Ultimate Geek
+1 received by user: 90


  Reply # 494751 18-Jul-2011 14:45
Send private message

I've had no experience with Telecom, but the command you have listed cannot work - the *nix command 'wget' expects a URL not a file on the local file system. '/usr/bin/wget' is simply the path to the 'wget' executable file. You need to make sure this is correct for the system that you are on.

If you want to call the PHP script directly, you'll need to use /path/to/php instead of /path/to/wget.

An alternative if you can't get cron to work locally is to use an online cron service to access the URL directly. Search on google for 'online crontab' for a few options.

1975 posts

Uber Geek
+1 received by user: 732

Trusted

  Reply # 494765 18-Jul-2011 15:00
Send private message

I am not talking about Telecom hosting here, but it shouldn't really be any different.

I have a couple of Drupal sites and they have a cron.php that you're supposed to run every now and then (it updates the search index and a few other things)

This is how I call it:

15 * * * * wget --quiet --delete-after http://my-uber-website.com/cron.php

That's the entry from crontab.

I have to 2nd what Kraven said though. Especially since you even say this: "I have confirmed the script does work as expected when you load it through a web browser."

You just need to get your wget to call the full URL of the page.




It looks like I'm using an adblocker. I should consider whitelisting Geekzone in my adblocker or a subscription. The Quick Reply box will appear for me when Geekzone is whitelisted. Hooray for me! If I want to reply to this topic I should click on Compose Reply.


4 posts

Wannabe Geek


  Reply # 494822 18-Jul-2011 15:41
Send private message

Hey Mate

Try this format.

If this doesn't work let me know and i can get it sorted for you.

"/usr/local/apache/global-bin/php.cgi $HOME/www/htdocs/360pm/mailscan.php "

This should be the correct format.

As above any issues let me know as i have a lot of experience with Telecom unix webhosting.

Jabbajaws

14118 posts

Uber Geek
+1 received by user: 1792


  Reply # 494826 18-Jul-2011 15:46
Send private message

I remember reading that they may now subcontract out their hosting now to a US company, and it is all hosted in the US. They however should provide you with support for that. You should phone them and say if you don't get support then you will be canceling the hosting, and moving to a host that does provide technical support.

Some hosts, especially the cheaper ones, do reduce the number of crons you can perform in a period of time, due to loads.



6 posts

Wannabe Geek


  Reply # 494928 18-Jul-2011 18:39
Send private message

Kraven: I've had no experience with Telecom, but the command you have listed cannot work - the *nix command 'wget' expects a URL not a file on the local file system. '/usr/bin/wget' is simply the path to the 'wget' executable file. You need to make sure this is correct for the system that you are on.

If you want to call the PHP script directly, you'll need to use /path/to/php instead of /path/to/wget.

An alternative if you can't get cron to work locally is to use an online cron service to access the URL directly. Search on google for 'online crontab' for a few options.


Thanks Kraven - was hoping someone familiar with Telecom's system would know where to reference wget from. Have looked at some of those online crontabs, good solution!


muppet: I am not talking about Telecom hosting here, but it shouldn't really be any different.

I have a couple of Drupal sites and they have a cron.php that you're supposed to run every now and then (it updates the search index and a few other things)

This is how I call it:

15 * * * * wget --quiet --delete-after http://my-uber-website.com/cron.php

That's the entry from crontab.

I have to 2nd what Kraven said though. Especially since you even say this: "I have confirmed the script does work as expected when you load it through a web browser."

You just need to get your wget to call the full URL of the page.


Thanks, I think the way you've written the command there is proper for crontab, but the control panel just wants the info after the time stuff ("15 * * * *").


mattwnz: I remember reading that they may now subcontract out their hosting now to a US company, and it is all hosted in the US. They however should provide you with support for that. You should phone them and say if you don't get support then you will be canceling the hosting, and moving to a host that does provide technical support.

Some hosts, especially the cheaper ones, do reduce the number of crons you can perform in a period of time, due to loads.


I have a sneaky suspicion you're right about the subcontracting, and yeah I was a bit annoyed that they would happily sell us a service and not give us any help with it. As it turns out, about an hour after posting this thread I got an e-mail back from them.


Jabbajaws: Hey Mate

Try this format.

If this doesn't work let me know and i can get it sorted for you.

"/usr/local/apache/global-bin/php.cgi $HOME/www/htdocs/360pm/mailscan.php "

This should be the correct format.

As above any issues let me know as i have a lot of experience with Telecom unix webhosting.

Jabbajaws


Hey Jabbajaws,

This actually made it work, thanks mate!

4 posts

Wannabe Geek


  Reply # 494959 18-Jul-2011 19:24
Send private message

Hey Mate

Great News

Ill be honest and say i work for Telecom within the Telecom Business Hub and have assisted with cron jobs before.

Our support team has had a refresh lately although that is not an excuse for the service you have received.

I will be sure to address this by submitting a resolution for cron jobs to make this wider knowledge and apologise for the lack in support in the first instance.

Moving forward Im sure they will have this at the ready.

Jabbajaws

*Please note my comments are not authorised by Telecom and are of my own voice and opinion just glad i was able to help.




6 posts

Wannabe Geek


  Reply # 495450 19-Jul-2011 21:23
Send private message

Hey, that's good to hear. What I would recommend is just posting a few "example commands" on the Business Hub FAQ area, like the one that you posted in response to me. Like I say, there's plenty of advice on the web about how to write crontab commands, but they don't help if you don't know how the remote server is configured!

Thanks again mate

Create new topic

Twitter »

Follow us to receive Twitter updates when new discussions are posted in our forums:



Follow us to receive Twitter updates when news items and blogs are posted in our frontpage:



Follow us to receive Twitter updates when tech item prices are listed in our price comparison site:





News »

Hawaiki Transpacific cable ready-for-service
Posted 20-Jul-2018 11:29


Microsoft Dynamics 365 Business Central launches
Posted 10-Jul-2018 10:40


Spark completes first milestone in voice platform upgrade
Posted 10-Jul-2018 09:36


Microsoft ices heated developers
Posted 6-Jul-2018 20:16


PB Technologies charged for its extended warranties and warned for bait advertising
Posted 3-Jul-2018 15:45


Almost 20,000 people claim credits from Spark
Posted 29-Jun-2018 10:40


Cove sells NZ's first insurance policy via chatbot
Posted 25-Jun-2018 10:04


N4L helping TAKA Trust bridge the digital divide for Lower Hutt students
Posted 18-Jun-2018 13:08


Winners Announced for 2018 CIO Awards
Posted 18-Jun-2018 13:03


Logitech Rally sets new standard for USB-connected video conference cameras
Posted 18-Jun-2018 09:27


Russell Stanners steps down as Vodafone NZ CEO
Posted 12-Jun-2018 09:13


Intergen recognised as 2018 Microsoft Country Partner of the Year for New Zealand
Posted 12-Jun-2018 08:00


Finalists Announced For Microsoft NZ Partner Awards
Posted 6-Jun-2018 15:12


Vocus Group and Vodafone announce joint venture to accelerate fibre innovation
Posted 5-Jun-2018 10:52


Kogan.com to launch Kogan Mobile in New Zealand
Posted 4-Jun-2018 14:34



Geekzone Live »

Try automatic live updates from Geekzone directly in your browser, without refreshing the page, with Geekzone Live now.



Are you subscribed to our RSS feed? You can download the latest headlines and summaries from our stories directly to your computer or smartphone by using a feed reader.

Alternatively, you can receive a daily email with Geekzone updates.