• Post Reply Bookmark Topic Watch Topic
  • New Topic

Cron Job every five minutes  RSS feed

 
Sham Jowsaki
Ranch Hand
Posts: 146
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
How can I run crob job every five minutes. Pls advice me with examples.
Thanks
Cheers
Jowsaki
 
Andrew Monkhouse
author and jackaroo
Marshal Commander
Posts: 12156
256
C++ Firefox Browser IntelliJ IDE Java Mac Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Jowsaki
In the column you want time divided, you put a division sign followed by the division.
I have the following crontab entry to download my email every 5 minutes:

Regards, Andrew
 
Sham Jowsaki
Ranch Hand
Posts: 146
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jus I got a solution from expert-exchange.com. anyhow Thanks Andrew..
 
Sham Jowsaki
Ranch Hand
Posts: 146
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Andrew,
I was trying to run the below cron job.. it is givin me an error.. can you pls advice me why?
Am runnin under solaris 8
*/5 * * * * /opt/emg/drivers/driveremg.sh
crontab: error on previous line; unexpected character found in line.
crontab: errors detected in input, no crontab file generated.
Tks
Cheers
Jowsaki
[ June 11, 2003: Message edited by: Sham Jowsaki ]
 
Barry Gaunt
Ranch Hand
Posts: 7729
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A typo: the first */ needs to be removed.
Try: "man -S 5 crontab" (or similar) to see the man page for the crontab file format.
-Barry
 
Andrew Monkhouse
author and jackaroo
Marshal Commander
Posts: 12156
256
C++ Firefox Browser IntelliJ IDE Java Mac Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Jowsaki
Sorry, the example I gave was for Linux, which does allow division:

Step values can be used in conjunction with ranges. Following a range with ``/<number>'' specifies skips of the number's value through the range. For example, ``0-23/2'' can be used in the hours field to specify command execution every other hour (the alternative in the V7 standard is ``0,2,4,6,8,10,12,14,16,18,20,22''). Steps are also permitted after an asterisk, so if you want to say ``every two hours'', just use ``*/2''.

According to Solaris manuals, you will have to use the V7 format (which is rather tedious to type out):

Regards, Andrew
 
Sham Jowsaki
Ranch Hand
Posts: 146
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes andrew, I did the same thing n it is working fine..
thanks a lot for all your help.
Cheers
Jowsaki
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!