FORUM HOME | WHUK BLOG   
WEB HOSTING UK AFFORDABLE WEBSITE HOSTING SERVICES IN UNITED KINGDOM
PHP LINUX SHARED HOSTING WINDOWS ASP.NET HOSTING PACKAGES
ECOMMERCE HOSTING ASP MSSQL MS ACCESS ODBC FRONTPAGE HOSTING
CPANEL WHM FANTASTICO RESELLER DEDICATED SERVER WEB HOSTING
CHEAP PLESK CPANEL HTML MYSQL BEST UK VPS HOSTING COMPANY
CHEAP RELIABLE UK HOSTING PROVIDER SINCE 2001
MANAGED WEB HOSTING SERVICE
AFFORDABLE WEBSITE HOSTING SERVICES IN UNITED KINGDOM

Web Hosting UK Forums | Linux Windows Dedicated Server and cPanel VPS Hosting Forum » Sales » WebHosting UK Services

Reply
 
LinkBack Thread Tools Display Modes

  #1 (permalink)  
Old 05-02-08, 08:33 AM
Member
 
Join Date: Jan 2008
Location: Lytham UK
Posts: 41
Default Wget

Hi I am trying to run a cron job once a day but wget (which chat told me is the command type to use) is giving an error

This is the cron

wget -q -o /dev/null wwwDOTwindermerelodgeDOTco.uk/send/send.php
(I have amended the command in case any naughty peeps tried to execute it
This is the result

/bin/sh: /usr/bin/wget: Permission denied

If I just use the

wwwDOTwindermerelodgeDOTco.uk/send/send.php

command in the address bar it executes fine

Any ideas?

John
Reply With Quote

  #2 (permalink)  
Old 05-02-08, 09:37 AM
Senior Member
 
Join Date: Jan 2007
Location: Dorset
Posts: 1,117
Default

I believe there are various methods to do this. I use root instead of a url:
php /home/username/public_html/send/send.php
and have no problems.

I actually have my db connection and cron files above root for further protection, so they can't be run from a browser. i.e:
php /home/username/send/send.php
Reply With Quote

  #3 (permalink)  
Old 05-02-08, 10:02 AM
Member
 
Join Date: Jan 2008
Location: Lytham UK
Posts: 41
Default

Hi Jon

Thanks that seems to have worked

To stop it sending me messages do I just add the /dev/null at the end?

Cheers John
Reply With Quote

  #4 (permalink)  
Old 05-02-08, 11:18 AM
Senior Member
 
Join Date: Jan 2007
Location: Dorset
Posts: 1,117
Default

Hi John, I think you append :
>/dev/null 2>&1
to the end to stop emails
http://wwwDOTadminschoice.com/docs/crontab.htm#Example

so : php /home/username/send/send.php > /dev/null 2>&1

Last edited by jon123; 05-02-08 at 11:27 AM.
Reply With Quote

  #5 (permalink)  
Old 05-02-08, 11:27 AM
Member
 
Join Date: Jan 2008
Location: Lytham UK
Posts: 41
Default

Thanks

I am familiar with the "/dev/null" bit what does the "2>&1" bit do?

Cheers

John

Answering my own question

> /dev/null pipes standard output to a black hole
2>&1 send error message to the same place

1 is standard output, 2 is error output

So to have only errors sent (which is in fact what I want) I just use > /dev/null

See a very useful article here for more detail

- http://wwwDOTxaprb.com/blog/2006/06/06/what-does-devnull-21-mean/

Last edited by Pommie; 05-02-08 at 11:33 AM.
Reply With Quote

  #6 (permalink)  
Old 05-02-08, 11:42 AM
Senior Member
 
Join Date: Jan 2007
Location: Dorset
Posts: 1,117
Default

Good article!

I actually want my emails, there has been a couple of instances where the cron jobs have stopped working. Something to do with a vps service stopping and not auto-restarting. Although this I understand has now been sorted, i still need to make sure that every day i get my 3 cron emails letting me know the scripts have been executed.
I am glad they are just daily though, if i received an email every 15 minutes i think i would need to blackhole them.
Reply With Quote

  #7 (permalink)  
Old 03-12-09, 05:17 PM
Junior Member
 
Join Date: Dec 2009
Posts: 15
Default

Email handling is not that easy.. Do not subscribe in their email list for your own good..
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
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump


All times are GMT. The time now is 08:18 AM.

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Copyright 2001-2010 Web Hosting UK. All rights reserved.
Web Hosting UK Forum





Site Map

Shared Cloud
Shared Cloud From £1

Affiliate Program
Earn up to £300 Per Sale

Dedicated Servers
Dedicated Server Hosting

Cloud Hosting
Cloud Server Hosting

Load Balanced Server
Load Balancing Server

VPS Hosting
Linux VPS Hosting

Windows VPS
Windows 2003 VPS

Zimbra Hosting
Zimbra Email Hosting

cPanel Hosting
Shared Linux Hosting

Windows Hosting
Shared Windows Hosting

Coldfusion Hosting
Windows Coldfusion Hosting

cPanel Reseller Hosting
Shared Windows Hosting

Windows Reseller
Windows Reseller Hosting

Email Web Hosting
Email Hosting

Semi-Dedicated Server
Semi-Dedicated Hosting

Remote Backup Plans
Offsite Backup Service


cpanel hosting
Knowledgebase Articles

Pre-Sales Question
Web Hosting FAQ's

Dedicated Hosting
Dedicated Server FAQ's

Virtual Private Servers
VPS Hosting

PHP MySQL Hosting
cPanel Hosting

Windows Hosting
ASP MSSQL Hosting

Domain Name
Domain registration FAQ's

CMS Hosting
CMS Hosting FAQ's

Payment Gateways
Payment FAQ's


Support Tutorials

cPanel Tutorials
cPanel Flash Tutorials

Wordpress Tutorials
Wordpress Flash Tutorials

Plesk Tutorials
Plesk Flash Tutorials

PhpMyadmin Tutorials
PhpMyadmin Flash Tutorials

Drupal Tutorials
Drupal Flash Tutorials

Mambo Tutorials
Mambo Flash Tutorials

Joomla Tutorials
Joomla Flash Tutorials

More Hosting Tutorials