Files
pdt/pdt.sh
Daniel Sosnowski 51dfad5cb4 changed logging
2026-01-15 16:11:40 +01:00

17 lines
463 B
Bash

#!/bin/bash
readarray -t files < /var/www/html/storage/focode/file_list_temp.txt
for file in "${files[@]}"
do
output=$(php compress.php process "$file")
if [[ $output -gt 0 ]]
then
echo "ERROR! Exiting the program"
echo "Processed file: $file - $output" | tee -a "/var/log/pdterr$(date +%d%m%Y).log"
echo "Log saved to /var/log/pdterr$(date +%d%m%Y).log"
exit 1
fi
echo "Processed file: $file - $output"
done