The UNIX and Linux Forums  


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
How to restart CRON file? biot UNIX for Dummies Questions & Answers 1 03-31-2008 09:19 AM
File Descriptors + cron matrixmadhan UNIX for Advanced & Expert Users 7 05-23-2007 02:53 PM
cron job to run php file christo16 UNIX for Dummies Questions & Answers 3 03-01-2007 11:55 AM
cron not deleting file baanprog UNIX for Dummies Questions & Answers 1 05-23-2006 10:08 AM
Viewing the cron file rinku11 Shell Programming and Scripting 2 02-24-2006 06:49 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 05-03-2006
jluyt jluyt is offline
Registered User
  
 

Join Date: May 2006
Posts: 2
Help with cron file

Hi everyone,

I need some help from the unix skills here to make sure I have a cron file correct. It should:

run the following php scripts at intervals:

cron.php every 15 minutes
cron_bounce.php every 12 hrs
cron_responder.php every 60 minutes
cron_pop.php every 30-60 minutes

my cron file looks like this and I think it might have some mistakes:

============

#!/usr/local/lib/php -q
15,30,45,59 * * * * /www/htdocs/12all/admin/cron.php
0 0,12 * * * /www/htdocs/12all/admin/cron_bounce.php
0 0-23 * * * /www/htdocs/12all/admin/cron_responder.php
0,30 * * * * /www/htdocs/12all/admin/cron_pop.php


====================

Does it look right, or how should it look?

Thanks for the help.
  #2 (permalink)  
Old 05-03-2006
RTM's Avatar
RTM RTM is offline Forum Advisor  
Hog Hunter
  
 

Join Date: Apr 2002
Location: On my motorcycle
Posts: 3,039
It looks fine except this line should not be there - that is for a script file.

#!/usr/local/lib/php -q
  #3 (permalink)  
Old 05-03-2006
indo1144's Avatar
indo1144 indo1144 is offline
Registered User
  
 

Join Date: Jun 2002
Location: Netherlands
Posts: 54
Quote:
Originally Posted by jluyt
cron.php every 15 minutes
cron_bounce.php every 12 hrs
cron_responder.php every 60 minutes
cron_pop.php every 30-60 minutes

my cron file looks like this and I think it might have some mistakes:

============

#!/usr/local/lib/php -q
15,30,45,59 * * * * /www/htdocs/12all/admin/cron.php
0 0,12 * * * /www/htdocs/12all/admin/cron_bounce.php
0 0-23 * * * /www/htdocs/12all/admin/cron_responder.php
0,30 * * * * /www/htdocs/12all/admin/cron_pop.php
Use crontab -e to open crontab editor and use this. I don't know what php -q does, so I did not use it below, but you probably could. And the top line (#!/usr/local/lib/php -q) has no place in a crontab-file.
Quote:
*/15 * * * * php /www/htdocs/12all/admin/cron.php
0 */12 * * * php /www/htdocs/12all/admin/cron_bounce.php
0 * * * * php /www/htdocs/12all/admin/cron_responder.php
*/30 * * * * php /www/htdocs/12all/admin/cron_pop.php
  #4 (permalink)  
Old 05-03-2006
RTM's Avatar
RTM RTM is offline Forum Advisor  
Hog Hunter
  
 

Join Date: Apr 2002
Location: On my motorcycle
Posts: 3,039
Jluyt,

Although Indo1144's example will work fine with the OS being used on his/her computer, it may not on yours (which is why you should state the OS and version you are using in all questions). Check your man pages for cron or crontab that the 'steps' can be used (where indo1144 used /15 for every 15 minutes).
  #5 (permalink)  
Old 05-04-2006
jluyt jluyt is offline
Registered User
  
 

Join Date: May 2006
Posts: 2
Version

red hat linux enterprize
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:25 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