Solved

cron every minute

Posted on 2014-10-17
8
59 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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
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.
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

758 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

20 Experts available now in Live!

Get 1:1 Help Now