Added an if statement and logging
This commit is contained in:
9
pdt.sh
9
pdt.sh
@@ -4,5 +4,12 @@ readarray -t files < /var/www/html/storage/focode/file_list_temp.txt
|
||||
|
||||
for file in "${files[@]}"
|
||||
do
|
||||
ls -l "$file"
|
||||
output=$(php compress.php process "$file")
|
||||
if [[ $output -gt 0 ]]
|
||||
then
|
||||
echo "ERROR! Exiting the program"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Processed file: $file: $output" | tee -a "/var/log/pdt$(date +%d%m%Y).log"
|
||||
done
|
||||
Reference in New Issue
Block a user