This is in UNIX AIX ..Need to configure at scheduler

aixtutorial
aixtutorial used Ask the Experts™
on
This is in UNIX AIX 5.3..Need to configure at scheduler..I have  a script which needs to be run every 5 mins and another script which should run every minute.I have done this in cron and its working by editing crontab -e

How can I do the same through at scheduler..where can I configure it and how can I run 2 scripts through at scheduler one running ecery minute and the other every 5 mins

I have the scripts in this location
/obiee/BI/setup/bin/script1.sh every 1 minute through at scheduler

/obiee/BI/setup/bin/script2.sh every 2 minute through at scheduler
The reason I want this to be run as at scheduler is .My cron has many other scripts which it runs  and for some reason crond goes down and we have to restart it every time..Please let me know as how to configure and use at scheduler as I dont want to get all the loadon cron


Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Most Valuable Expert 2013
Top Expert 2013

Commented:
Hi,

"at" is meant for running one-time jobs at a later time,
thus it's not suitable for your needs.

You would need something like cron to set up an at job every minute, which sounds kind of bizarre to me.

But why should cron die?

Do you see messages in errpt?


wmp

Author

Commented:
wmp.

As always thanks for responding.I also wanted to learn at scheduler so thouht of working on it..
so,as what you said will I not be able to run at scheduler every minute or every 5 mins

Most Valuable Expert 2013
Top Expert 2013

Commented:
No,

it's not meant for repeated jobs, but has to be set up anew for every single job (which can then run far in the future, of course).

There's no other scheduler built into AIX, unfortunately, but there are third-party products, be it commercial or open source:

http://jobscheduler.sourceforge.net/osource_scheduler_presentation_en.htm
http://www.rocsoftware.com/pages/job_scheduling

etc.


wmp
Top Expert 2011
Commented:
> I not be able to run at scheduler every minute or every 5 mins

In the script (borne or bash)

while true
do
  something
  sleep 60 # Wait 60 seconds
done

Then your script will run every 1 minute
sleep 300 will make it run every 5 minutes
Alternatively, your script could schedule the *next* run one minute away, then do its work for this run.
echo $0 $@ | at now + 1 minute
command1
command2
rest of commands

Open in new window


Start it off with:
  echo /full/path/to/script.sh parm1 parm2 | at now

One general problem with self-scheduling systems like this is that they might slowly drift out of time - there is always a small delay before the script actually runs, so when it sets "now + 1 minute", it might be 61 or more seconds since it last did that work - you end up running the script every 61 or more seconds rather than every 60 seconds.  You are probably safe with at, though - on the systems I have tested, it runs things exactly on the minute so won't drift.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial