×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Need to set cron job for 45 min time interval

Need to set cron job for 45 min time interval

Need to set cron job for 45 min time interval

(OP)
Hi All,

I am not sure whether I am asking this on right forum or not but I have problem while setting the cron job.
I am trying to set the job run time for .sh file from every 1 hour to 45 min time interval, but unable to set the time.

I tried these two methods to set the time

0-59/45 * * * * * * * * exec /appl/prod/bin/test.sh >/dev/null 2>&1

*/45 * * * * * * * * exec /appl/prod/bin/test.sh >/dev/null 2>&1
 

and in both cases getting this error - crontab: error on previous line; unexpected character found in line.

 

Please suggest. Thanks in advance.

 

RE: Need to set cron job for 45 min time interval

Hi. I'm not quite sure whether I fully understand what you want, but I don't think Solaris supports the 59/45 expression. Perhaps use * 45 * * * <command>?

The internet - allowing those who don't know what they're talking about to have their say.

RE: Need to set cron job for 45 min time interval

(OP)
Hi Ken,

Thanks for your reply. I need to run the job at 45 min time interval. For example if I set the test.sh file in cron starting at 00:00 then it should run at 00:00 AM then 00:45 AM then 01:30 AM then 02:15 AM then 03:00 AM then 03:45 AM etc. I mean at 45 minutes of time interval. To do this I used the above syntax but getting error. How can I do this?.

Please advice.

RE: Need to set cron job for 45 min time interval

I see, thanks for clarifying. I think what I would do in such circumstances woul be to include a sleep 2700 in the script so that it loops every 45 minutes. You could then simply kick it off once from cron (or init) and let it do it's stuff.

The internet - allowing those who don't know what they're talking about to have their say.

RE: Need to set cron job for 45 min time interval

(OP)
Hmm... that would be an good option.

Thanks for your reply.

RE: Need to set cron job for 45 min time interval

Or you can make a wrapper and run every 15 minute:

* 0,15,30,45 * * * <command>?


And the you call the other script every third time.
 

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login


Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close