The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Re : Pass parameters from Cron job to Java code samshaw High Level Programming 1 12-05-2008 07:01 AM
problem mailing HTML code in cron file. abhishek.mind UNIX for Advanced & Expert Users 1 09-25-2008 06:59 AM
Terminal And Cron Job Return Different Status Code isaac_ho Shell Programming and Scripting 1 06-02-2008 01:12 AM
how to convert from korn shell to normal shell with this code? forevercalz Shell Programming and Scripting 21 11-23-2005 02:18 AM
End of Error correction kristian UNIX for Dummies Questions & Answers 1 01-07-2002 11:42 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 03-21-2009
whybelieve whybelieve is offline
Registered User
  
 

Join Date: Mar 2009
Posts: 1
cron job - shell code correction

Hi I have a website that is having problem with cron jobs...

I have a cron job set up to go to a page with this code...

<?
include('config.php');
if($_sys->bible_email_frequency == 'DAILY')
{
$u = new user();
$u->send_bible_email();
}
?>

If i send my browser to this page then the action occurs okay but if I set a cron job to go there I get no action at all. Some one said that this code is not shell compliant and it needs to be.

Can anyone correct it for me?

Thanks
  #2 (permalink)  
Old 03-21-2009
Arunprasad Arunprasad is offline
Registered User
  
 

Join Date: Aug 2008
Location: syn chen
Posts: 73
A user cannot use the crontab command if one of the following is true:
* The cron.allow file and the cron.deny file do not exist (allows root user only).
* The cron.allow file exists but the user's login name is not listed in it.
* The cron.deny file exists and the user's login name is listed in it.

check man crontab.
  #3 (permalink)  
Old 03-21-2009
KenJackson KenJackson is offline
Registered User
  
 

Join Date: May 2008
Location: Maryland, USA
Posts: 105
Quote:
Originally Posted by whybelieve View Post
I have a cron job set up to go to a page with this code...
I've never heard of using cron to visit web pages. Maybe it will work, but I would do whatever you are doing with a Bash shell script.

But since you already have it all setup as a PHP script, you could probably do it something like this. Here I'm assuming you want it to run at 1:15 AM every day. If you don't have access to the actual crontab, then just ignore the leading numbers and asterisks.
Code:
15 1 * * *  /usr/bin/php  /some/path/file.php
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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




All times are GMT -4. The time now is 05:07 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0