Initial Commit

This commit is contained in:
Cloud User
2024-03-06 17:45:49 -06:00
commit 8986493161
250 changed files with 43078 additions and 0 deletions

23
pgsql-log/get-logs.sh Normal file
View File

@@ -0,0 +1,23 @@
#!/bin/bash
# Source and destination directories
SRC_DIR="/var/lib/pgsql/15/data/log/"
DEST_DIR="/usr/share/nginx/html/paad/pgsql-log/"
# Days of the week
DAYS=("Mon" "Tue" "Wed" "Thu" "Fri" "Sat" "Sun")
echo "Done"
# Iterate over each day and copy the file if it exists
for day in "${DAYS[@]}"; do
src_file="${SRC_DIR}postgresql-${day}.log"
dest_file="${DEST_DIR}postgresql-${day}.log"
if [[ -f "$src_file" ]]; then
sudo cp "$src_file" "$dest_file"
echo "Copied ${src_file} to ${dest_file}"
else
echo "File ${src_file} not found"
fi
done