?
Solved

linux cron job

Posted on 2006-11-06
6
Medium Priority
?
451 Views
Last Modified: 2010-04-20
hello,
I need 3 cron jobs every 24 hours
3:01am
3:02am
3:03am

for
/usr/bin/php /home/virtual/var/www/html/page1.php > /dev/null
/usr/bin/php /home/virtual/var/www/html/page2.php > /dev/null
/usr/bin/php /home/virtual/var/www/html/page3.php > /dev/null

can someone help me ?
0
Comment
Question by:Sabrin
[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
  • 3
  • 2
6 Comments
 
LVL 45

Accepted Solution

by:
sunnycoder earned 2000 total points
ID: 17880021
Hi Sabrin,

1 3 * * * /usr/bin/php /home/virtual/var/www/html/page1.php > /dev/null
2 3 * * * /usr/bin/php /home/virtual/var/www/html/page2.php > /dev/null
3 3 * * * /usr/bin/php /home/virtual/var/www/html/page3.php > /dev/null

Cheers!
sunnycoder
0
 
LVL 6

Expert Comment

by:_iskywalker_
ID: 17880022
Cron has the arguments
Minutes hours days Month weekdays command

1 3 * * * /usr/bin/php /home/virtual/var/www/html/page1.php > /dev/null
2 3 * * * /usr/bin/php /home/virtual/var/www/html/page2.php > /dev/null
3 3 * * * /usr/bin/php /home/virtual/var/www/html/page3.php > /dev/null


put it in your cron.tab
0
 
LVL 6

Expert Comment

by:_iskywalker_
ID: 17880026
**** sunnycoder was one minute (or less than 60 seconds)  faster...
0
NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

 
LVL 11

Expert Comment

by:elbereth21
ID: 17880033
Hi Sabrin,
if I understand correctly, you only need to set the time of execution for these three processes, so:
01,02,03 03 *** /usr/bin/php /home/virtual/var/www/html/index.php > /dev/null

Elbereth.
0
 
LVL 11

Expert Comment

by:elbereth21
ID: 17880041
You were both faster than me, but what puzzles me is, where did I get that index.php from??? :)
0
 
LVL 11

Expert Comment

by:elbereth21
ID: 17880048
Just in case, you need it for future reference, here is an useful help page for cron syntax:
http://www.linuxhelp.net/guides/cron/
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Setting up Secure Ubuntu server on VMware 1.      Insert the Ubuntu Server distribution CD or attach the ISO of the CD which is in the “Datastore”. Note that it is important to install the x64 edition on servers, not the X86 editions. 2.      Power on th…
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 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 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…
Suggested Courses

762 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