improof DB Clean

This commit is contained in:
6543 2019-05-11 19:30:09 +02:00
parent 7931150ca2
commit 3d541dd359
2 changed files with 3 additions and 2 deletions

View File

@ -22,6 +22,7 @@
readonly TTSYNC_REMOTE=2 readonly TTSYNC_REMOTE=2
readonly TTSYNC_DEL=3 readonly TTSYNC_DEL=3
readonly globalconf="/etc/tt/global" readonly globalconf="/etc/tt/global"
[ -z "$DEBUG" ] && readonly DEBUG=$FALSE
} }


{ #get options & args { #get options & args

View File

@ -14,7 +14,7 @@
readonly TTSYNC_REMOTE=2 #file exists remote - not used jet readonly TTSYNC_REMOTE=2 #file exists remote - not used jet
readonly TTSYNC_DEL=3 #local file deleted readonly TTSYNC_DEL=3 #local file deleted
readonly globalconf="/etc/tt/global" readonly globalconf="/etc/tt/global"
readonly DEBUG=$FALSE [ -z "$DEBUG" ] && readonly DEBUG=$FALSE
} }


{ #get options & args { #get options & args
@ -64,7 +64,7 @@ function main() {


#clean DB from old stuff #clean DB from old stuff
{ {
db_query "DELETE From File WHERE Size=0 OR MD5='' OR MD5 IS NULL OR Name='';" db_query "DELETE From File WHERE (Size=0 OR Size IS NULL OR MD5='' OR MD5 IS NULL OR Name='') AND (TTSync=$TTSYNC_EXIST OR TTSync=$TTSYNC_BACKUP);"
#find dublicates ! #find dublicates !
} }