Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Easy Instructions On Setting Up a Cron Job Required

Posted on 2007-04-03
6
Medium Priority
?
255 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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
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

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

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

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…
Fine Tune your automatic Updates for Ubuntu / Debian
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Suggested Courses
Course of the Month11 days, 13 hours left to enroll

636 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