Document Type | Technical Information
Category | Monitoring/Inspection
Applicable Product Versions | 5SP1FS01, 5SP1FS02, 5SP1FS03, 5SP1FS04, 5SP1FS06, 6FS01, 6FS02, 6FS03, 6FS04, 6FS05, 6FS06, 6FS07, 6FS07PS, 7FS01, 7FS02, 7FS02PS
Document Number | TMOTI006
Overview
This guide explains how to repeatedly execute specific commands and sql files/scripts.
This feature allows you to sequentially register multiple commands and file executions (e.g., execute command 1 โ execute command 2), making it convenient for monitoring.
NoteThis is applicable in Linux and Unix environments, but since Windows does not support this syntax, batch files containing the goto command need to be created.
Method
while true; do; command1; command2; sleep time(in seconds); done
[Syntax Example]
while true;
do echo ================================;
date;
top -bn1 | grep "Cpu(s)" | awk '{printf("CPU Usage: %.1f%%\n", 100 - $8)}';
echo;
echo ================================;
sleep 5;
done
-- Commands start from echo
-- Example of displaying CPU usage every 5 seconds
================================
2025. 02. 24. (Mon) 11:04:06 KST
CPU Usage: 2.5%
================================
================================
2025. 02. 24. (Mon) 11:04:11 KST
CPU Usage: 0.8%
================================