mirror of
https://github.com/Ark0N/Codeman.git
synced 2026-10-20 17:19:33 +02:00
17 lines
453 B
Bash
17 lines
453 B
Bash
#!/bin/bash
|
|||
|
|
# Generates timestamped data to a file for testing
|
||
|
|
# Usage: ./scripts/data-generator.sh [output_file] [interval_seconds]
|
||
|
|
# Then: tail -f /tmp/test-data.log
|
||
|
|
|
||
|
|
OUTPUT="${1:-/tmp/test-data.log}"
|
||
|
|
INTERVAL="${2:-1}"
|
||
|
|
|
||
|
|
echo "Writing to $OUTPUT every ${INTERVAL}s (Ctrl+C to stop)"
|
||
|
|
echo "Run: tail -f $OUTPUT"
|
||
|
|
|
||
|
|
i=0
|
||
|
|
while true; do
|
||
|
|
((i++))
|
||
|
|
echo "[$(date '+%Y-%m-%d %H:%M:%S')] Line $i - Random: $RANDOM" >> "$OUTPUT"
|
||
|
|
sleep "$INTERVAL"
|
||
|
|
done
|