Some end to end flow working

This commit is contained in:
Dillon Shook
2024-10-22 22:56:06 -04:00
parent f6ce2d8c84
commit e88be84fda
4 changed files with 66 additions and 50 deletions

View File

@@ -2,10 +2,18 @@ currentDateTime=$(date +"%Y-%m-%dT%H:%M")
for logFile in /var/log/nginx-shared/*.log; do
# Ensure the log isn't empty
if [ -s $logFile ]; then
rotatedLog="$logFile-$currentDateTime.log"
report="$logFile-$currentDateTime.html"
filename=$(basename "$logFile")
appName=${filename%%--*}
appPath="/var/log/nginx-shared/$appName"
# Make directory for all the reports to live in
mkdir -p $appPath
rotatedLog="$logFile--$currentDateTime.log"
report="$appPath/$filename--$currentDateTime.html"
if [ -f "$report" ]; then
echo "$report already exists, skipping"