Solved

Easy Instructions On Setting Up a Cron Job Required

Posted on 2007-04-03
6
247 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
6 Comments
 
LVL 5

Accepted Solution

by:
suggestionstick earned 250 total points
Comment Utility
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
Comment Utility
Thanks Trev - I'll give it a try and let you know very shortly.
0
 
LVL 14

Assisted Solution

by:ygoutham
ygoutham earned 250 total points
Comment Utility
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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 84

Expert Comment

by:ozo
Comment Utility
man cron
man crontab
0
 
LVL 5

Expert Comment

by:suggestionstick
Comment Utility
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
Comment Utility
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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

This is the error message I got (CODE) Error caused by incompatible libmp3lame 3.98-2 with ffmpeg I've googled this error message and found out sometimes it attaches this note "can be treated with downgrade libmp3lame to version 3.97 or 3.98" …
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

744 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now