aspose file tools*
The moose likes General Computing and the fly likes  i want call my method every one hour except 12 am (Using cron job ) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » General Computing
Bookmark " i want call my method every one hour except 12 am (Using cron job )" Watch " i want call my method every one hour except 12 am (Using cron job )" New topic
Author

i want call my method every one hour except 12 am (Using cron job )

ayyappan Bas
Ranch Hand

Joined: Oct 11, 2008
Posts: 39

Hi All

i want invoke my method every one hour except 12 am .Currently i am using cron job .could you please any one help on this problem .the following expression will invoke my method on every one hour .

ex :
0 0 0/1 1/1 * ?


Thanks & Regards
Ayyappan
Richard Tookey
Ranch Hand

Joined: Aug 27, 2012
Posts: 1084
    
  10

Being a Java forum this seems a funny place to post this in but you should look at the man page

man 5 crontab

which describes the fields and explains how to set up a range of values. Hint - you need to two ranges on the hour field.
ayyappan Bas
Ranch Hand

Joined: Oct 11, 2008
Posts: 39
The first five fields are:
minute (0-59)
hour (0-23)
day of the month(1-31)
month of the year (1-12)
day of the week (0-6 with 0 = Sunday)

Each field can be an asterisk meaning all values, or a single integer, several integers separated by commas, or two integers separated by a hypen to indicate a range.
fred rosenberger
lowercase baba
Bartender

Joined: Oct 02, 2003
Posts: 11480
    
  16

Richard Tookey wrote:Hint - you need to two ranges on the hour field.

are you sure?

I assume 12 a.m. means midnight, not noon, but the term seems to be somewhat ambiguous.

If the OP means midnight, I think one range works. If they meant noon, then yes, two ranges.
Richard Tookey
Ranch Hand

Joined: Aug 27, 2012
Posts: 1084
    
  10

fred rosenberger wrote:
Richard Tookey wrote:Hint - you need to two ranges on the hour field.

are you sure?

I assume 12 a.m. means midnight, not noon, but the term seems to be somewhat ambiguous.

If the OP means midnight, I think one range works. If they meant noon, then yes, two ranges.


I assumed that 12 a.m. was midday but of course if it is midnight then only one range is needed.

P.S. I did wonder if a single range between 13 and 11 would work; one day I might try it!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: i want call my method every one hour except 12 am (Using cron job )