]> granicus.if.org Git - sysstat/blob - sa1.in
sar/sadc: Add stable identifier support for disks statistics
[sysstat] / sa1.in
1 #!/bin/sh
2 # @SA_LIB_DIR@/sa1
3 # (C) 1999-2019 Sebastien Godard (sysstat <at> orange.fr)
4 #
5 #@(#) @PACKAGE_NAME@-@PACKAGE_VERSION@
6 #@(#) sa1: Collect and store binary data in system activity data file.
7 #
8
9 # Set default value for some variables.
10 # Used only if ${SYSCONFIG_DIR}/sysstat doesn't exist!
11 HISTORY=0
12 SADC_OPTIONS=""
13 SA_DIR=@SA_DIR@
14 SYSCONFIG_DIR=@SYSCONFIG_DIR@
15 UMASK=0022
16
17 [ -r ${SYSCONFIG_DIR}/sysstat ] && . ${SYSCONFIG_DIR}/sysstat
18
19 umask ${UMASK}
20
21 [ -d ${SA_DIR} ] || SA_DIR=@SA_DIR@
22
23 if [ ${HISTORY} -gt 28 ]
24 then
25         SADC_OPTIONS="${SADC_OPTIONS} -D"
26 fi
27
28 ENDIR=@SA_LIB_DIR@
29 cd ${ENDIR}
30 [ "$1" = "--boot" ] && shift && BOOT=y || BOOT=n
31 if [ $# = 0 ] && [ "${BOOT}" = "n" ]
32 then
33 # Note: Stats are written at the end of previous file *and* at the
34 # beginning of the new one (when there is a file rotation) only if
35 # outfile has been specified as '-' on the command line...
36         exec ${ENDIR}/sadc -F -L ${SADC_OPTIONS} 1 1 ${SA_DIR}
37 else
38         exec ${ENDIR}/sadc -F -L ${SADC_OPTIONS} $* ${SA_DIR}
39 fi