ChamplainTechJournals/automation-sys320/week11/getLogs.bash
2025-04-19 23:42:08 -04:00

14 lines
213 B
Bash

#!/bin/bash
logDir="/var/log/apache2/"
allLogs=$(ls "${logDir}" | grep "access.log" | grep -v "other_vhosts")
echo "${allLogs}"
:> access.txt
for i in ${allLogs}
do
cat "${logDir}${i}" >> access.txt
done