yes a branch would be good - fixes ...

This commit is contained in:
6543 2019-05-11 23:02:43 +02:00
parent 3ff5bcb9a9
commit 50eef4fbd5

View File

@ -1,6 +1,6 @@
#!/bin/bash #!/bin/bash
# @author 6543 # @author 6543
# @version 1.0 # @version 1.1
# @date 2019-05-11 # @date 2019-05-11


## Options/Parameter ## Options/Parameter
@ -78,7 +78,7 @@ function main() {
grep -vf "$list_tmp/indb" "$list_tmp/exist" > "$list_tmp/new" grep -vf "$list_tmp/indb" "$list_tmp/exist" > "$list_tmp/new"


#all IDs wich an old check date: #all IDs wich an old check date:
db_query "SELECT ID FROM File Where TTCheck < '$DATE' OR TTCheck IS NULL;" | while read line; do db_query "SELECT ID FROM File Where (TTCheck < '$DATE' OR TTCheck IS NULL) AND (TTSync=$TTSYNC_EXIST OR TTSync=$TTSYNC_BACKUP);" | while read line; do
#for each ID with an old check date ... #for each ID with an old check date ...
ID=$line ID=$line
[ $DEBUG == $TRUE ] && echo "Progress ID: $ID" >&2 [ $DEBUG == $TRUE ] && echo "Progress ID: $ID" >&2
@ -86,7 +86,7 @@ function main() {
if [ -f "$FILE" ]; then if [ -f "$FILE" ]; then
SIZE=$(db_query "SELECT Size FROM File WHERE ID=$ID;") SIZE=$(db_query "SELECT Size FROM File WHERE ID=$ID;")
SIZE_new="$(file_size "$FILE")" SIZE_new="$(file_size "$FILE")"
[ "$SIZE" != "$SIZE_new" ] && { if [ "$SIZE" != "$SIZE_new" ]; then
echo "FILE CHANGE: $FILE" echo "FILE CHANGE: $FILE"
if [ "0" == "$SIZE_new" ]; then if [ "0" == "$SIZE_new" ]; then
#file exist but to smal #file exist but to smal
@ -107,7 +107,10 @@ function main() {
fi fi


fi fi
} else
#add timestamp that nothing has changed
db_query "UPDATE File SET TTCheck='$DATE' WHERE ID=$ID;"
fi
else else
# file dont exist # file dont exist
echo "FILE DEL/MV: $FILE" echo "FILE DEL/MV: $FILE"