?
Solved

Easy Instructions On Setting Up a Cron Job Required

Posted on 2007-04-03
6
Medium Priority
?
254 Views
Last Modified: 2013-12-15
Can someone let me know how I setup a cron job on a Linux server (Apache) to run the following:

/home/default/domain-name.com/user/htdocs/crons/cron.php

I need it to run every 15 minutes but I am a) a newbie when it comes to cron jobs on Linux and b) need it setup asap. Any questions please fire away!

Thanks
0
Comment
Question by:AndoverIT
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 5

Accepted Solution

by:
suggestionstick earned 1000 total points
ID: 18843449
Hi

use

use the crontab tool

crontab -u "insert username that you want cron to run under here"  -e (this might be default, what user has perms on cron.php)

add the following line

*/15 * * * * * /home/default/domain-name.com/user/htdocs/crons/cron.php

save and exit


Trev
0
 

Author Comment

by:AndoverIT
ID: 18843501
Thanks Trev - I'll give it a try and let you know very shortly.
0
 
LVL 14

Assisted Solution

by:ygoutham
ygoutham earned 1000 total points
ID: 18843825
small correction

crontab -u <username> -e

added line should be

*/15 * * * * /usr/bin/php  /home/default/domain-name.com/user/htdocs/crons/cron.php

it is essential to tell the system to use the php executable to run the php file.  or change the "/usr/bin/php" to wherever the php binary is
0
Get MongoDB database support online, now!

At Percona’s web store you can order your MongoDB database support needs in minutes. No hassles, no fuss, just pick and click. Pay online with a credit card. Handle your MongoDB database support now!

 
LVL 84

Expert Comment

by:ozo
ID: 18849015
man cron
man crontab
0
 
LVL 5

Expert Comment

by:suggestionstick
ID: 18849372
Hi


yes indeed "ygoutham" is spot on, you should specify the full path to the php, just incase it is not in the cron job owners path

try the following command to locate php

which php


Trev
0
 

Author Comment

by:AndoverIT
ID: 18928739
Thanks for all the tips guys - and sorry about the delay. Have now managed (I think) to get it setup and should have an answer in the morning if it worked.

Thanks
0

Featured Post

Will your db performance match your db growth?

In Percona’s white paper “Performance at Scale: Keeping Your Database on Its Toes,” we take a high-level approach to what you need to think about when planning for database scalability.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

How many times have you wanted to quickly do the same thing to a list but found yourself typing it again and again? I first figured out a small time saver with the up arrow to recall the last command but that can only get you so far if you have a bi…
I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
Suggested Courses
Course of the Month15 days, 2 hours left to enroll

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question