Ce script bash génère un rapport de synthèse de l’environnement de sauvegarde TiNa. Il affiche les informations de base du serveur, liste les hôtes configurés pour les sauvegardes dans TiNa, vérifie l’état des agents TiNa sur plusieurs machines, affiche la taille et le contenu des répertoires de catalogues, et liste les cartouches recyclables disponibles pour les prochaines opérations de sauvegarde.
Scrip Bash
Ce script est à paramétrer dans la crontab afin de générer régulièrement un résumé complet sur l’état des hosts couverts par TiNa.
#━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ # Last version : 2024-09-25 #━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ # README ═══════════════════════════════════════════════════════════════════════════════════════════ # This script # - Displays basic information of the host # - Lists the hosts saved by TiNa # - Displays the size of the directory where the catalogs are saved # - Displays the last catalog(s) saved # The following line shall be added to the crontab ---------------------------------------------- # 00 7 * * 1 /root/TiNa-scripts/TiNa-HostsList.sh | mailx -v -s "[TiNa] - Backup informations of $HOSTNAME" -S smtp=mail.my.company.org -S from="[email protected]" [email protected] #━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
echo -e "┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" echo -e "┃ CHECKING IF TINA AGENT IS RUNNING" echo -e "┣━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" echo -e "┃-------------------------------------------------------------------" echo -e "┃ TiNa agent is running" echo -e "┃-------------------------------------------------------------------" for host in"${HOST_LST[@]}"; do output=$(${TiNa_PATH_INSTALL}tina_ping -host "$host" | grep 'is running') if [ -n "$output" ]; then echo -e "┃ $output" fi done echo -e "┃-------------------------------------------------------------------" echo -e "┃ TiNa agent is NOT running" echo -e "┃-------------------------------------------------------------------" for host in"${HOST_LST[@]}"; do output=$(${TiNa_PATH_INSTALL}tina_ping -host "$host" | grep 'is not running') if [ -n "$output" ]; then echo -e "┃ $output" fi done echo -e "┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo -e "┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" echo -e "┃ OTHER PROBLEMS" echo -e "┣━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" for host in"${HOST_LST[@]}"; do output=$(${TiNa_PATH_INSTALL}tina_ping -host "$host" | grep -v 'running') if [ -n "$output" ]; then echo -e "┃ $output" fi
#======================================== # Main Program #======================================== tina_host_summary tina_list_host tina_agent_check backup_catalog_size tina_cartridges