SA2(8)
๐
SA2(8) โ your girl's guide to sa2
okay so real talk, we're in the Linux User's Manual, section 8 (that's the admin-commands section, iykyk), and today's main character is sa2. buckle up bestie ๐
โจ NAME โจ
sa2 โ makes a report out of the current standard system activity daily data file. that's it, that's the gig ๐
๐ธ SYNOPSIS ๐ธ
/usr/lib/sa/sa2
literally just that path, no cap. she lives at /usr/lib/sa/sa2 and she takes flags (more on that in a sec) ๐ฆ
๐ฆ DESCRIPTION ๐ฆ
so sa2 is a shell procedure variant of the sar command โ like, sar's cute cousin who's got her own whole thing going on. what she does is write a daily report into the sarDD file, or the sarYYYYMMDD file, and here's the decoder ring:
YYYY= the current yearMM= the current monthDD= the current day
by default that report is saved in the /var/log/sa directory. iconic. ๐
and she's not just a report-girlie, she's also a little bit of a cleaner: sa2 will also remove reports more than one week old, by default. yes bestie, she declutters for you ๐งนโจ but like โ you can keep reports for a longer (or a shorter) period by setting the HISTORY environment variable. that's the whole vibe check. read the sysstat(5) manual page for details, because yours truly is not gonna recite it all here ๐
oh and also โ the sa2 command accepts most of the flags and parameters of the sar command. so all your sar muscle memory? transfers. slay. ๐ฅ
and the big one: sa2 is designed to be started automatically by the cron command. she's a set-it-and-forget-it queen ๐
โญ EXAMPLES โญ
wanna run sa2 daily? obviously. place the following entry in your root crontab file:
5 19 * * 1-5 /usr/lib/sa/sa2 -A
and that, by default, will generate a daily report called sarDD in the /var/log/sa directory โ where the DD parameter is a number representing the day of the month. cute right? ๐
ngl, that's the root crontab specifically โ don't go putting it in your own user crontab and then wondering why nothing happened ๐ญ
๐ FILES ๐
/var/log/sa/sarDD/var/log/sa/sarYYYYMMDD
these are the standard system activity daily report files, and this is their default location. again for the people in the back: YYYY stands for the current year, MM for the current month, and DD for the current day. ๐
๐ AUTHOR ๐
Sebastien Godard (sysstat <at> orange.fr) โ thank you for your service king ๐ซถ
๐ SEE ALSO ๐
and if you wanna go deeper (you do, I know you):
okay that's the whole page!! ๐ this one shipped from the Linux release of the manual, dated AUGUST 2023, and it's filed under SA2(8) โ so go forth, cron her up, and let the daily reports come to you. mwah ๐โจ
๐ฆ where this page comes from
- alpine 3.24: sysstat-doc 12.7.8-r0 ยท GPL-2.0-or-later
- arch rolling: sysstat 12.8.0-1 ยท GPL-2.0-only
- (C) 1999-2020 Sebastien Godard (sysstat <at> orange.fr)
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms