Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This question already has an answer here:

In Ubuntu, I can install sysstat using apt, e.g.

apt-get install sysstat

And then enable it via interactive prompt

dpkg-reconfigure sysstat

But I want automate the process using fully automated shell script, what command I can use?

share|improve this question

marked as duplicate by quanta, mdpc, Khaled, faker, Nils Mar 12 '13 at 11:41

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

up vote 0 down vote accepted
apt-get install sysstat -y
echo 'ENABLED="true"' > /etc/default/sysstat
service sysstat restart

save as say: /root/enSAR.sh, make executable chmod +x /root/enSAR.sh, then run as root:

~# sh /root/enSAR.sh

Checked, if you are running Ubuntu, then that should work. Debian uses additional values in /etc/default/sysstat

share|improve this answer

Service may be configured via update-rc.d

Cron job uses settings from /etc/default/sysstat, string ENABLED="true"

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.