Merge pull request #1 from dsosnowskipiga/testing

Testing
This commit is contained in:
2026-01-16 16:15:44 +01:00
committed by GitHub

11
pdt.sh
View File

@@ -4,12 +4,21 @@ readarray -t files < /var/www/html/storage/focode/file_list_temp.txt
for file in "${files[@]}" for file in "${files[@]}"
do do
if [[ -f "/var/www/html/storage/focode/processed_files.txt" && $(grep -c "$file" "/var/www/html/storage/focode/processed_files.txt") -gt 0 ]]
then
echo "Skipping already processed file: $file"
continue
fi
output=$(php compress.php process "$file") output=$(php compress.php process "$file")
if [[ $output -gt 0 ]] if [[ $output -gt 0 ]]
then then
echo "ERROR! Exiting the program" 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 exit 1
fi fi
echo "Processed file: $file: $output" | tee -a "/var/log/pdt$(date +%d%m%Y).log" echo "Processed file: $file - $output" | tee -a /var/www/html/storage/focode/processed_files.txt
done done