• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • We are looking for U.S.-based freelancer or agency working with SEO or WordPress for a quick 30-min interviews to gather feedback on XOVI, a successful German SEO tool we’re looking to launch in the U.S.
    If you qualify and participate, you’ll receive a $30 Amazon gift card as a thank-you. Please apply here. Thanks for helping shape a better SEO product for agencies!
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.
Resource icon

Instruction How to find the busiest website by reading access log file

Here is a update to the code.

what i did was added easyer see how much traffic a website uses and put them last so its easy at a glance

#!/bin/bash

# Clear any existing queue file
> rxqueue.txt

# Find all access_log files under /var/www/vhosts and add them to the queue file
find /var/www/vhosts/system -name access_*_log > rxqueue.txt

# Temporary file to store sizes and paths
> size_output.txt

# Process each entry in the queue file
while IFS= read -r r; do
# Get the size of each file using the 'stat' command
size=$(stat -c '%s' "$r")

# Convert size to appropriate unit
if [ "$size" -ge 1073741824 ]; then
# Size is 1 GB or more
size_human=$(echo "scale=2; $size/1073741824" | bc)G
elif [ "$size" -ge 1048576 ]; then
# Size is 1 MB or more
size_human=$(echo "scale=2; $size/1048576" | bc)M
elif [ "$size" -ge 1024 ]; then
# Size is 1 KB or more
size_human=$(echo "scale=2; $size/1024" | bc)K
else
# Size is in bytes
size_human="${size}B"
fi

# Output size and file path to temporary file
echo "$size $size_human $r" >> size_output.txt
done < rxqueue.txt

# Sort by size (numeric, ascending) and print with human-readable units and paths
sort -n size_output.txt | awk '{print $2, $3}'

# Clean up temporary files
rm rxqueue.txt size_output.txt

# End of the script
Back
Top