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

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 05-03-2006
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.
Reply With Quote
Sponsored Links
  #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
Reply With Quote
  #3 (permalink)  
Old 05-03-2006
indo1144's Avatar
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
Reply With Quote
  #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).
Reply With Quote
  #5 (permalink)  
Old 05-04-2006
Registered User
 

Join Date: May 2006
Posts: 2
Version

red hat linux enterprize
Reply With Quote
Google The UNIX and Linux Forums
Reply

Bookmarks

Tags
None

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:




All times are GMT -4. The time now is 07:15 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66