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.

I have just enabled sysstat on one of my servers (Ubuntu 12.04), I have noticed it is logging all to

/var/log/sysstat/sa04
/var/log/sysstat/sa05
/var/log/sysstat/sar04

How can I change the sysstat logging path to another folder on another disk?

Looked through the configs couldn't find anything :(

share|improve this question

2 Answers 2

I am not sure about ubuntu but in Fedora node,here is the scenario

[root@test ~]# cat /etc/cron.d/sysstat

Run system activity accounting tool every 10 minutes

*/10 * * * * root /usr/lib64/sa/sa1 1 1

Generate a daily summary of process accounting at 23:53

53 23 * * * root /usr/lib64/sa/sa2 -A

If you open any of these scripts

less /usr/lib64/sa/sa1

SYSCONFIG_DIR=/etc/sysconfig

[ -r ${SYSCONFIG_DIR}/sysstat ] && . ${SYSCONFIG_DIR}/sysstat

if [ ${HISTORY} -gt 28 ]

then

    CURRENTDIR=`date +%Y%m`
    DATE=`date +%d`
    CURRENTFILE=sa${DATE}
    DDIR=/var/log/sa  <-----------------------------
    cd ${DDIR} || exit 1

Check DDIR variable,so look like its hardcoded here,so if you want to give any customize/change path you can add here.

share|improve this answer

@user1901030 provided an answer that requires you to edit the script. Workable, but if the script gets upgraded, your changes will be overwritten.

Rather, I recommend you perform a bindmount on top of /var/log/sysstat. Edits in /etc/fstab are almost never touched by package updates.

The command to do a bindmount would be:

mount -o bind /path/on/different/drive /var/log/sysstat

When it's mounted, enter the mount command to get all the fstab incantations.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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