This commit is contained in:
2023-09-18 19:08:35 +00:00
parent d6bc6dde37
commit 76fe06b0df
28 changed files with 1259 additions and 1064 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