Solved

cron every minute

Posted on 2014-10-17
8
65 Views
Last Modified: 2014-10-24
hi expets

i want to schedule a cron job every minute Mon to Fri

i want to schedule a cron job every minute 7 days of the week.

Any idea what the cron syntax expression should be ?

thanks.
0
Comment
Question by:royjayd
  • 5
  • 3
8 Comments
 
LVL 86

Expert Comment

by:CEHJ
ID: 40387360
afaicr - not possible (>= 5 mins)
0
 

Author Comment

by:royjayd
ID: 40387388
sorry, what is afaicr ?
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 40387400
As Far As I Can Remember (see why i wrote it now? ;))

The usual response to the question is something along the lines of 'use a looping shell script instead' but of course, you're in the Java TA so ...
0
 

Author Comment

by:royjayd
ID: 40387425
ok. Can you tell me what is cron date/ time expression if i have to run every 5 minutes 7 days a week.

for every 5 hours monday to friday i have
0 0/5 * * * MON-FRI

what would it be for every 5 minutes 7 days a week?

thanks.
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 86

Accepted Solution

by:
CEHJ earned 500 total points
ID: 40387464
*/5 * * * * /usr/bin/foo

Open in new window

i think - better check ;)
0
 

Author Comment

by:royjayd
ID: 40387506
thanks
so if */5 * * * * /usr/bin/foo schedules every 5 minutes,
*/1 * * * * /usr/bin/foo should schedule every one minute, right ?
I thought only seconds level scheduling is not possible with cron, correct me if i am wrong.
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 40387604
Sorry - i must have been remembering some other limit. Doh!

Yes, that will work or just

* * * * * /usr/bin/foo 

Open in new window

0
 
LVL 86

Expert Comment

by:CEHJ
ID: 40401718
:)
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.

929 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

10 Experts available now in Live!

Get 1:1 Help Now