How to automate the sar to get the history in /var/adm/sa


I have solaris 8 server . i need to get last night sar output but ny server is not automated for taking the sar history how can i do it.

How do i automate the sar to get the history in /var/adm/sa

Is there any command other than puting it in the cron ?
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

You can put something like the following in the crontab:

5,35 * * * * /usr/lib/sa/sa1 >/dev/null 2>&1

use need to login as root or su as root, then type in:

export EDITOR
ccrontab -e

in vi mode, add
5,35 * * * * /usr/lib/sa/sa1 >/dev/null 2>&1

save and exit from vi

man crontab
man sar
to learn more details.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
also have a look at "How to set up sar":

sar crontab runs under the 'sys' user, so you'd want to do

crontab -e sys

and uncomment (and optionally change the frequency) of the sa jobs.
Cloud Class® Course: Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

You can run sar as root !
You *can* run sar as root, but the default on Solaris is to run as the 'sys' user.  The sys user crontab already has sar entries in it that just need uncommenting to enable.
Edit the sys crontab and un-comment the entries for sar.  

(make sure the vi is your default editor or things get ugly)

crontab -e sys

There will be some lines in there for sar... If I remember correctly 3 lines.... uncomment then and you're done.... sar will begin collecting stats.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Unix OS

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.