]> granicus.if.org Git - sysstat/commit
Added option -[0-9]* to sar to show data of that days ago.
authorSebastien <seb@kluane.home>
Sat, 30 Jun 2012 20:32:38 +0000 (22:32 +0200)
committerSebastien <seb@kluane.home>
Sun, 1 Jul 2012 13:56:39 +0000 (15:56 +0200)
commit00472302ed16b410703b3678281e5a4f3349d66c
tree57bfdc0278fcfc20fbe7dc67fe60929e9743d7f6
parent9ef0b9a31c831a4c5f7a2919e7a7540b642bdf86
Added option -[0-9]* to sar to show data of that days ago.

Mail from Don <do1@yandex.ru> 22/06/2012:

Hello Sysstat author(s),

Please add option `-[0-9]+' like `-1', `-2', etc. to sar tool, to show
data of that days ago. That would be handy and useful for everybody.

Example implementation in bash:

function sar() {
        case "$1" in -[0-9]*) local OPT="-f /var/log/sa/sa`date +%d
--date=${1#-}' day ago'`"; shift;; esac
        command sar $OPT "$@"
}

Limitation of this implementation is that -1 option should be first, but
if you implement this type of options in main code you can avoid it and
also many people will benefit. It will easier than to rememebr proper
date and type `-f /var/log/sa/saXX'.

Best regards,
Don.
14 files changed:
CHANGES
cifsiostat.c
common.c
common.h
iostat.c
man/sar.in
mpstat.c
nfsiostat.c
pidstat.c
sa.h
sa_common.c
sadc.c
sadf.c
sar.c