Solved

linux cron job

Posted on 2006-11-06
6
440 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
Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure 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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

In my business, I use the LTS (Long Term Support) versions of Linux. My workstations do real work, and so I rarely have the patience to deal with silly problems caused by an upgraded kernel that had experimental software on it to begin with from a r…
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 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.

839 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