Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

add comment

2 Answers

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
add comment

Service may be configured via update-rc.d

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

share|improve this answer
add comment

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