Skipping processed files
This commit is contained in:
16
pdt.sh
16
pdt.sh
@@ -1,10 +1,25 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [[ -f /var/www/html/storage/focode/processed_files.txt]]
|
||||
then
|
||||
readarray -t processed_files < /var/www/html/storage/focode/processed_files.txt
|
||||
fi
|
||||
|
||||
readarray -t files < /var/www/html/storage/focode/file_list_temp.txt
|
||||
|
||||
for file in "${files[@]}"
|
||||
do
|
||||
for processed_file in "${processed_files[@]}"
|
||||
do
|
||||
if [[ "$file" == "$processed_file" ]]
|
||||
then
|
||||
echo "Skipping already processed file: $file"
|
||||
continue
|
||||
fi
|
||||
|
||||
output=$(php compress.php process "$file")
|
||||
echo "$processed_file" >> /var/www/html/storage/focode/processed_files.txt
|
||||
|
||||
if [[ $output -gt 0 ]]
|
||||
then
|
||||
echo "ERROR! Exiting the program"
|
||||
@@ -14,4 +29,5 @@ do
|
||||
fi
|
||||
|
||||
echo "Processed file: $file - $output"
|
||||
done
|
||||
done
|
||||
Reference in New Issue
Block a user