Skip to content

Instantly share code, notes, and snippets.

@pancudaniel7
Created January 18, 2024 20:51
Show Gist options
  • Save pancudaniel7/feb223789e038f665edf08a59aef9cd1 to your computer and use it in GitHub Desktop.
Save pancudaniel7/feb223789e038f665edf08a59aef9cd1 to your computer and use it in GitHub Desktop.
#!/bin/bash
# Size of each log message
LOG_MESSAGE_SIZE=100000
# Function to rapidly log messages
function log_messages {
for i in {1..100000}; do
LOG_MESSAGE=$(head -c "$LOG_MESSAGE_SIZE" /dev/urandom | tr -dc 'A-Za-z0-9')
logger -p user.notice "$LOG_MESSAGE"
done
}
echo "Starting to fill the syslog to trigger logrotate..."
log_messages
echo "Finished logging messages."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment