Help with cron file


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Help with cron file
# 1  
Old 05-03-2006
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  
Old 05-03-2006
It looks fine except this line should not be there - that is for a script file.

#!/usr/local/lib/php -q
# 3  
Old 05-03-2006
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  
Old 05-03-2006
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  
Old 05-04-2006
Version

red hat linux enterprize
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Ftp bash script appends to file using cron instead of coping new file

I have a bash script that is running a mysql query and creating a csv file with a time stamp. It then uploads that to a ftp server. Everything works great when I manually run it. But then I have a cron job set to run every monday, wednesday and friday at 5am est. When the cron job runs, it... (7 Replies)
Discussion started by: akallenberger
7 Replies

2. UNIX for Dummies Questions & Answers

Execution problem with Cron: Script works manually but not w/Cron. Why?

Hello gurus, I am making what I think is a simple db2 call from within a shell script but I am having difficulty producing the desired report when I run the script shown below from a shell script in cron. For example, my script and the crontab file setup is shown below: #!/bin/ksh db2... (3 Replies)
Discussion started by: okonita
3 Replies

3. Shell Programming and Scripting

Cron job - Need to run Cron every quarter at particular time

Hi, 1) If some job supposed to run on 1st of every month at 7 AM In cron job when we have a blackout on the 1st ( i.e when 1st falls on a sunday ) how can we make the job run the next business day? 2) How can we run a job on 25th of every quarter 7 AM(jan,apr,jul,oct) And if 25th... (5 Replies)
Discussion started by: System Admin 77
5 Replies

4. UNIX for Advanced & Expert Users

cron cannot create the file.

#For the test1.sh crontab 35 11 * * * /home/tolamas/suru/MailingScript/test1.sh #test1.sh cat /home/tolamas/suru/reports/test11.res RCPT_LIST="st0030761@techmahindra.com" SUBJECT="test mail dated ${MAIL_DATE} " FROM="surekha.tolamatti@techmahindra.com" ( cat... (2 Replies)
Discussion started by: surekha268
2 Replies

5. Shell Programming and Scripting

cron cannot create the file..

#For the test1.sh crontab 35 11 * * * /home/tolamas/suru/MailingScript/test1.sh #test1.sh cat /home/tolamas/suru/reports/test11.res RCPT_LIST="st0030761@techmahindra.com" SUBJECT="test mail dated ${MAIL_DATE} " FROM="surekha.tolamatti@techmahindra.com" ( cat... (0 Replies)
Discussion started by: surekha268
0 Replies

6. UNIX for Dummies Questions & Answers

How to restart CRON file?

Hi How can I restart the CRON manually? Thanks (1 Reply)
Discussion started by: biot
1 Replies

7. AIX

AIX and cron logs filtering ?: /etc/cronlog.conf, /var/adm/cron/log

Hi, I can use 'crontabs –e' and do all the scheduling I like. However I would like to auto send myself just the cronjobs logs that fail. That is to say the PIDs that fail and the related lines with those PID’s only. (Not the full set of logs) Has anyone done this work? Or does an AIX 5.3 tool... (0 Replies)
Discussion started by: Keith Johnson
0 Replies

8. UNIX for Advanced & Expert Users

File Descriptors + cron

Hi All, This thread is going to be a discussion basically bringing out more information from the experts on cron jobs and the associated file handles. So, here is the question. There is definitely a constant ' n ' as the maximum number of file handles alloted to a process ' p '. Will... (7 Replies)
Discussion started by: matrixmadhan
7 Replies

9. Shell Programming and Scripting

Viewing the cron file

Hi All, I am trying to look into the crontab file present in /var/spool/cron/crontab. A file with the name of the superuser name is present there with the -r-------- permission. Even I am logged in using the same superuser id. But while am trying to cat that, its prompting permission denied. ... (2 Replies)
Discussion started by: rinku11
2 Replies

10. UNIX for Dummies Questions & Answers

Editing a CRON file

Hi, I am accessing CRON via telnet and want to set up some jobs. I have typed crontab -e to edit my cronfile but I can't seem to enter anything when I type on my keyboard. All I have is a flashing cursor at the top with ~ on the start of each line. How can I enter the jobs and save this... (9 Replies)
Discussion started by: jaffy1229
9 Replies
Login or Register to Ask a Question