test files

This commit is contained in:
marcel-dempers 2025-03-29 13:24:23 +11:00
parent dcc40aee57
commit 18a07247d0
4 changed files with 42 additions and 0 deletions

View File

@ -0,0 +1,26 @@
#!/bin/bash
# Directory to create large files in
TARGET_DIR="/var/log/app_logs"
mkdir -p "$TARGET_DIR"
# Number of files to create
NUM_FILES=1000
# Size of each file in MB
FILE_SIZE_MB=1
# Create large files
for i in $(seq 1 $NUM_FILES); do
TIME=$(date +%YYYY%m%d%H%M%s%N)
mkdir -p "$TARGET_DIR/$TIME"
dd if=/dev/zero of="$TARGET_DIR/$TIME/app_${i}.log" bs=1M count=$FILE_SIZE_MB
done
# Wait for all background processes to finish
wait
#give time to troubleshoot
sleep 60
echo "Disk usage simulation complete. Large files created in $TARGET_DIR."

View File

@ -0,0 +1,4 @@
#!/bin/bash
# Connect to the TCP server on localhost port 12345
echo "Connecting to TCP server on localhost port 12345..."
echo "Sending one message and holding connection!" | nc localhost 12345

View File

@ -0,0 +1,8 @@
#!/bin/bash
echo "Connecting to TCP server on localhost port 12345..."
echo "Sending messages one after another!"
while true; do
echo "Sending message and closing connection!" | nc -q 5 localhost 12345
done

View File

@ -0,0 +1,4 @@
#!/bin/bash
echo "Starting TCP server on port 12345..."
nc -lk 12345