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.


Psychd

6 posts

Wannabe Geek


#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
Kraven
729 posts

Ultimate Geek


  #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.



muppet
2568 posts

Uber Geek

Trusted

  #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.




Audiophiles are such twits! They buy such pointless stuff: Gold plated cables, $2000 power cords. Idiots.

 

OOOHHHH HYPERFIBRE!


Jabbajaws
4 posts

Wannabe Geek


  #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



mattwnz
20149 posts

Uber Geek


  #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.

Psychd

6 posts

Wannabe Geek


  #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!

Jabbajaws
4 posts

Wannabe Geek


  #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.


Psychd

6 posts

Wannabe Geek


  #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





News and reviews »

Air New Zealand Starts AI adoption with OpenAI
Posted 24-Jul-2025 16:00


eero Pro 7 Review
Posted 23-Jul-2025 12:07


BeeStation Plus Review
Posted 21-Jul-2025 14:21


eero Unveils New Wi-Fi 7 Products in New Zealand
Posted 21-Jul-2025 00:01


WiZ Introduces HDMI Sync Box and other Light Devices
Posted 20-Jul-2025 17:32


RedShield Enhances DDoS and Bot Attack Protection
Posted 20-Jul-2025 17:26


Seagate Ships 30TB Drives
Posted 17-Jul-2025 11:24


Oclean AirPump A10 Water Flosser Review
Posted 13-Jul-2025 11:05


Samsung Galaxy Z Fold7: Raising the Bar for Smartphones
Posted 10-Jul-2025 02:01


Samsung Galaxy Z Flip7 Brings New Edge-To-Edge FlexWindow
Posted 10-Jul-2025 02:01


Epson Launches New AM-C550Z WorkForce Enterprise printer
Posted 9-Jul-2025 18:22


Samsung Releases Smart Monitor M9
Posted 9-Jul-2025 17:46


Nearly Half of Older Kiwis Still Write their Passwords on Paper
Posted 9-Jul-2025 08:42


D-Link 4G+ Cat6 Wi-Fi 6 DWR-933M Mobile Hotspot Review
Posted 1-Jul-2025 11:34


Oppo A5 Series Launches With New Levels of Durability
Posted 30-Jun-2025 10:15









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.