sadm_client_sunset.sh

3 minute read

NAME

sadm_client_sunset.sh
Clients end of day housekeeping and producing system information files

SYNOPSIS

sadm_client_sunset.sh [-d 0-9] [-h] [-v]
$SADMIN/bin/sadm_client_sunset.sh - v2.1
Posted 2021-05-31 - Updated 2021-06-03
Supported on Linux, Aix, MacOS
Can be executed on a client and on the SADMIN Server.

DESCRIPTION

The main function of this script is to execute various housekeeping on a SADMIN client. Remember, the SADMIN server is also consider a client. This script is run daily near the end of the day, by default it run around 23:23. All it’s doing actually, is execute the four scripts listed below ;

1- sadm_client_housekeeping.sh
The function of this script is to perform various housekeeping, such as deleting old logs and history files not used for a number of days specified in the SADMIN configuration file.

2- sadm_dr_savefs.sh
Save system filesystems information in order to recreate them from scratch in a LVM environment.

3- sadm_create_sysinfo.sh
This script is use to collect different software and hardware about the system you are running it and record this information in the System Information File.

4- sadm_cfg2html.sh This script use cfg2html is a little utility to collect the necessary system configuration files and system set-up to an ASCII file and HTML file.

Portion of the SADMIN client crontab

# SADMIN Client Crontab File 
# Please don't edit manually, SADMIN Tools generated file
SADMIN=/sadmin
# 
# Run Daily before midnight
# Housekeeping, Save Filesystem Info, Create SysInfo & run cfg2html
23 23 * * *  sadmin sudo ${SADMIN}/bin/sadm_client_sunset.sh > /dev/null 2>&1

Back to the top

EXAMPLE

# sadm_client_sunset.sh 
================================================================================
Thu 03 Jun 2021 12:20:07 PM EDT - sadm_client_sunset.sh V2.10 - SADM Lib. V3.70
Server Name: ubuntu2004.maison.ca - Type: LINUX
UBUNTU 20.04 Kernel 5.8.0-53-generic
==================================================
 
[ OK ] /opt/sadmin/bin/sadm_client_housekeeping.sh 
[ OK ] /opt/sadmin/bin/sadm_dr_savefs.sh 
[ OK ] /opt/sadmin/bin/sadm_create_sysinfo.sh 
[ OK ] /opt/sadmin/bin/sadm_cfg2html.sh 

==================================================
Script exit code is 0 (Success) and execution time is 00:01:29
History (/opt/sadmin/dat/rch/ubuntu2004_sadm_client_sunset.rch) trim to 35 lines.
Script will send an alert only when it terminate with error ($SADM_ALERT_TYPE=1).
Script succeeded, no alert will be send to 'default' alert group.
New log (/opt/sadmin/log/ubuntu2004_sadm_client_sunset.log) created ($SADM_LOG_APPEND='N').
End of sadm_client_sunset.sh - Thu 03 Jun 2021 12:21:29 PM EDT
================================================================================

Back to the top

OPTIONS

Options Description
[ -d 0-9 ] Set debug level from 0 to 9 (Default is 0)
[ -h ] Display this help and exit.
[ -v ] Output version information and exit.

ENVIRONMENT

  • The “$SADMIN” environment variable must be defined and contains the root directory of the SADMIN tools (normally /opt/sadmin). It should be already done, the setup script have updated the ‘/etc/profile.d/sadmin.sh’ and the ‘/etc/environment’ files.
  • The SADMIN configuration file, is needed and loaded in memory at the beginning of every scripts. This file should already exist and contains your SADMIN configuration and preference setting.
  • For Shell script the Shell Library is used and for Python script the Python Library is used.

EXIT STATUS

Exit Code Description
0 An exit status of zero indicates success.
1 Failure is indicated by a nonzero value, typically ‘1’.

AUTHOR

Jacques Duplessis
Any suggestions or bug report can be submitted at the support page

Copyright © 2021 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later
This is free software, you are free to change and redistribute it.
There is NO WARRANTY to the extent permitted by law.

SEE ALSO

sadm_client_sunset.sh - Clients end of day housekeeping and producing system information files
sadm_client_housekeeping.sh - Purge old log,rch,nmon files and check $SADMIN permission
sadm_create_sysinfo.sh - Collect hardware & software information about the system
System Information File - Documentation about the system information file
sadm_dr_savefs.sh - Save system filesystems information in order to recreate them from scratch.
sadm_cfg2html.sh - Get System information and creates a HTML web page of it.