mirror of
https://github.com/marcel-dempers/docker-development-youtube-series.git
synced 2025-06-06 17:01:30 +00:00
test files
This commit is contained in:
parent
dcc40aee57
commit
18a07247d0
@ -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."
|
@ -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
|
@ -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
|
@ -0,0 +1,4 @@
|
||||
#!/bin/bash
|
||||
|
||||
echo "Starting TCP server on port 12345..."
|
||||
nc -lk 12345
|
Loading…
x
Reference in New Issue
Block a user