REDROOM
PHP 8.5.2
Path:
Logout
Edit File
Size: 1.54 KB
Close
//lib/sysstat/sa2
Text
Base64
#!/bin/bash # /usr/lib/sysstat/sa2 # (C) 1999-2022 Sebastien Godard (sysstat <at> orange.fr) # #@(#) sysstat-12.6.1 #@(#) sa2: Write a daily report # S_TIME_FORMAT=ISO ; export S_TIME_FORMAT prefix=/usr exec_prefix=${prefix} SA_DIR=/var/log/sysstat SYSCONFIG_DIR=/etc/sysstat SYSCONFIG_FILE=sysstat HISTORY=7 COMPRESSAFTER=10 ZIP="xz" UMASK=0022 ENDIR= DELAY_RANGE=0 # Read configuration file, overriding variables set above [ -r ${SYSCONFIG_DIR}/${SYSCONFIG_FILE} ] && . ${SYSCONFIG_DIR}/${SYSCONFIG_FILE} umask ${UMASK} # Wait for a random delay if requested if [ ${DELAY_RANGE} -gt 0 ] then RANDOM=$$ DELAY=$((${RANDOM}%${DELAY_RANGE})) sleep ${DELAY} fi [ -d ${SA_DIR} ] || SA_DIR=/var/log/sysstat # if YESTERDAY=no then today's summary is generated if [ x$YESTERDAY = xno ] then DATE_OPTS= else DATE_OPTS="--date=yesterday" fi if [ ${HISTORY} -gt 28 ] then DATE=`date ${DATE_OPTS} +%Y%m%d` else DATE=`date ${DATE_OPTS} +%d` fi CURRENTFILE=sa${DATE} CURRENTRPT=sar${DATE} RPT=${SA_DIR}/${CURRENTRPT} DFILE=${SA_DIR}/${CURRENTFILE} if [ -z "${ENDIR}" ]; then ENDIR=${exec_prefix}/bin fi [ -f "${DFILE}" ] || exit 0 cd ${ENDIR} if [ x${REPORTS} != xfalse ] then ${ENDIR}/sar.sysstat "$@" -f ${DFILE} > ${RPT} fi SAFILES_REGEX='/sar?[0-9]{2,8}(\.(Z|gz|bz2|xz|lz|lzo))?$' find "${SA_DIR}" -type f -mtime +${HISTORY} \ | grep -E "${SAFILES_REGEX}" \ | xargs rm -f UNCOMPRESSED_SAFILES_REGEX='/sar?[0-9]{2,8}$' find "${SA_DIR}" -type f -mtime +${COMPRESSAFTER} \ | grep -E "${UNCOMPRESSED_SAFILES_REGEX}" \ | xargs -r "${ZIP}" > /dev/null exit 0
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 0 × Files: 4
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
debian-sa1
446 B
lrwxr-xr-x
2024-01-09 20:31:44
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
sa1
1.71 KB
lrwxr-xr-x
2024-01-09 20:31:44
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
sa2
1.54 KB
lrwxr-xr-x
2024-01-09 20:31:44
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
sadc
81.25 KB
lrwxr-xr-x
2024-01-09 20:31:44
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).