Solved

linux cron job

Posted on 2006-11-06
6
434 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
Comment Utility
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_
Comment Utility
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_
Comment Utility
**** sunnycoder was one minute (or less than 60 seconds)  faster...
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 11

Expert Comment

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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Little introduction about CP: CP is a command on linux that use to copy files and folder from one location to another location. Example usage of CP as follow: cp /myfoder /pathto/destination/folder/ cp abc.tar.gz /pathto/destination/folder/ab…
Introduction We as admins face situation where we need to redirect websites to another. This may be required as a part of an upgrade keeping the old URL but website should be served from new URL. This document would brief you on different ways ca…
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…

728 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

8 Experts available now in Live!

Get 1:1 Help Now