Solved

linux cron job

Posted on 2006-11-06
6
437 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
  • 3
  • 2
6 Comments
 
LVL 45

Accepted Solution

by:
sunnycoder earned 500 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
VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

 
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

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

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

Suggested Solutions

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…
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…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

785 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