# sadc(8) - man - phpMan

[SADC(8)](https://www.chedong.com/phpMan.php/man/SADC/8/markdown)                                  Linux User's Manual                                 [SADC(8)](https://www.chedong.com/phpMan.php/man/SADC/8/markdown)



## NAME
       sadc - System activity data collector.


## SYNOPSIS
       **/usr/lib/sysstat/sadc**  **[** **-C** _comment_ **]** **[** **-D** **]** **[** **-F** **]** **[** **-f** **]** **[** **-L** **]** **[** **-V** **]** **[** **-S** **{** _keyword_**[,...]**
       **|** **ALL** **|** **XALL** **}** **]** **[** _interval_ **[** _count_ **]** **]** **[** _outfile_ **]**


## DESCRIPTION
       The **sadc** command samples system data a specified number of times (_count_) at a  specified  in‐
       terval  measured  in seconds (_interval_).  It writes in binary format to the specified _outfile_
       or to standard output. If _outfile_ is set to **-**, then **sadc** uses the  standard  system  activity
       daily  data  file (see below).  In this case, if the file already exists, **sadc** will overwrite
       it if it is from a previous month. By default **sadc** collects most of the data  available  from
       the  kernel.  But there are also optional metrics, for which the relevant options must be ex‐
       plicitly passed to **sadc** to be collected (see option **-S** below).

       The standard system activity daily data file is named _saDD_ unless option **-D** is used, in which
       case its name is _saYYYYMMDD_, where _YYYY_ stands for the current year, _MM_ for the current month
       and _DD_ for the current day. By default it is located in the _/var/log/sysstat_  directory.  Yet
       it is possible to specify an alternate location for it: If _outfile_ is a directory (instead of
       a plain file) then it will be considered as the directory where the standard system  activity
       daily data file will be saved.

       When the _count_ parameter is not specified, **sadc** writes its data endlessly. When both _interval_
       and _count_ are not specified, and option **-C** is not used, a dummy record, which is used at sys‐
       tem startup to mark the time when the counter restarts from 0, will be written.  For example,
       one of the system startup script may write the restart mark to the daily  data  file  by  the
       command entry:

### /usr/lib/sysstat/sadc -

       The **sadc** command is intended to be used as a backend to the **sar** command.

       Note: The **sadc** command only reports on local activities.


## OPTIONS
### -C
              When  neither  the  _interval_ nor the _count_ parameters are specified, this option tells
              **sadc** to write a dummy record containing the specified _comment_ string. This comment can
              then be displayed with option **-C** of **sar**.

### -D

### -F
              unknown to **sadc** then it will be truncated. This may be useful  for  daily  data  files
              created by an older version of **sadc** and whose format is no longer compatible with cur‐
              rent one.

### -f
              mal  operation  in  that  a  sudden  system reset is less likely to result in the _saDD_
              datafiles being corrupted. However, this is at the expense of performance  within  the
              **sadc**  process  as forward progress will be blocked while data is written to underlying
              disk instead of just to cache.

### -L
              ing it. Failure to get the lock is fatal, except in the case of trying to write a nor‐
              mal (i.e. not a dummy and not a header) record to an existing file, in which case **sadc**
              will  try again at the next interval. Usually, the only reason a lock would fail would
              be if another **sadc** process were also writing to the file. This can happen when **cron** is
              used  to  launch  **sadc**.  If the system is under heavy load, an old **sadc** might still be
              running when **cron** starts a new one. Without locking, this situation can  result  in  a
              corrupted system activity file.

### -S
              Possible keywords are **DISK**, **INT**, **IPV6**, **POWER**, **SNMP**, **XDISK**, **ALL** and **XALL**.
              Specify  which  optional  activities should be collected by **sadc**.  Some activities are
              optional to prevent data files from growing too large. The **DISK** keyword indicates that
              **sadc** should collect data for block devices. The **INT** keyword indicates that **sadc** should
              collect data for system interrupts. The **IPV6** keyword indicates  that  IPv6  statistics
              should  be  collected  by  **sadc**.  The **POWER** keyword indicates that **sadc** should collect
              power management statistics. The **SNMP** keyword indicates that SNMP statistics should be
              collected  by **sadc**. The **ALL** keyword is equivalent to specifying all the keywords above
              and therefore all previous activities are collected.

              The **XDISK** keyword is an extension to the **DISK** one and indicates  that  partitions  and
              filesystems  statistics  should  be  collected by **sadc** in addition to disk statistics.
              This option works only with kernels 2.6.25 and later. The **XALL** keyword  is  equivalent
              to  specifying all the keywords above (including keyword extensions) and therefore all
              possible activities are collected.

              Important note: The activities (including optional ones) saved  in  an  existing  data
              file  prevail over those selected with option **-S**.  As a consequence, appending data to
              an existing data file will result in option **-S** being ignored.

### -V


## ENVIRONMENT
       The **sadc** command takes into account the following environment variable:

       **S**___**TIME**___**DEF**___**TIME**
              If this variable exists and its value is **UTC** then **sadc** will save its data in UTC time.
              **sadc**  will also use UTC time instead of local time to determine the current daily data
              file located in the _/var/log/sysstat_ directory.


## EXAMPLES
### /usr/lib/sysstat/sadc 1 10 /tmp/datafile
              Write 10 records of one second intervals to the _/tmp/datafile_ binary file.

### /usr/lib/sysstat/sadc -C "Backup Start" /tmp/datafile
              Insert the comment "Backup Start" into the file _/tmp/datafile_.


## BUGS
       The _/proc_ filesystem must be mounted for the **sadc** command to work.

       All the statistics are not necessarily available, depending on the kernel version used.  **sadc**
       assumes that you are using at least a 2.6 kernel.


## FILES
       _/var/log/sysstat/saDD_
       _/var/log/sysstat/saYYYYMMDD_
              The standard system activity daily data files and their default location.  _YYYY_ stands
              for the current year, _MM_ for the current month and _DD_ for the current day.
       _/proc_ and _/sys_ contain various files with system statistics.


## AUTHOR
       Sebastien Godard (sysstat <at> orange.fr)


## SEE ALSO
       [**sar**(1)](https://www.chedong.com/phpMan.php/man/sar/1/markdown), [**sa1**(8)](https://www.chedong.com/phpMan.php/man/sa1/8/markdown), [**sa2**(8)](https://www.chedong.com/phpMan.php/man/sa2/8/markdown), [**sadf**(1)](https://www.chedong.com/phpMan.php/man/sadf/1/markdown), [**sysstat**(5)](https://www.chedong.com/phpMan.php/man/sysstat/5/markdown)

       _<https://github.com/sysstat/sysstat_>
       _<http://pagesperso-orange.fr/sebastien.godard/_>



Linux                                         JULY 2020                                      [SADC(8)](https://www.chedong.com/phpMan.php/man/SADC/8/markdown)
