it hopefuully works now
This commit is contained in:
parent
062bddbeec
commit
0435efe615
|
@ -23,7 +23,7 @@ recursive_backup() {
|
||||||
if [[ ${k///} == $k ]]; then filepath="."; else filepath=${k%/*}; fi # if file in root of dir, change the path to not crash everything ,else get filepath
|
if [[ ${k///} == $k ]]; then filepath="."; else filepath=${k%/*}; fi # if file in root of dir, change the path to not crash everything ,else get filepath
|
||||||
draw_progress $(($progress)) "$k" "$action"
|
draw_progress $(($progress)) "$k" "$action"
|
||||||
#remotehash="$(cat $hashtemp | grep -n "$k")" # old databese
|
#remotehash="$(cat $hashtemp | grep -n "$k")" # old databese
|
||||||
sqlcommand="SELECT hash FROM files WHERE backpath=\"${k}\""
|
sqlcommand="SELECT hash FROM files WHERE backpath=\"${k}\";"
|
||||||
remotehash="""$(sqlite3 $hashtemp "$sqlcommand")""" # get hash from database
|
remotehash="""$(sqlite3 $hashtemp "$sqlcommand")""" # get hash from database
|
||||||
if [[ -z $remotehash ]]; then entryexists=false; else entryexists=true; fi # if file entry (and hash) exists, save as bool
|
if [[ -z $remotehash ]]; then entryexists=false; else entryexists=true; fi # if file entry (and hash) exists, save as bool
|
||||||
localhash="$(md5sum "$k")" # hash of local version of file
|
localhash="$(md5sum "$k")" # hash of local version of file
|
||||||
|
@ -64,7 +64,7 @@ backup() { # backup 1:<file> 2:<remotedir>
|
||||||
else
|
else
|
||||||
if [[ "$enctype" == "gpg" ]]; then encdata="$RECIPIENT_ID"
|
if [[ "$enctype" == "gpg" ]]; then encdata="$RECIPIENT_ID"
|
||||||
else encdata=""; fi
|
else encdata=""; fi
|
||||||
sqlcommand="INSERT INTO files(backpath,localroot,hash,backupenc,encdata) VALUES(\'${2}\',\'$(pwd)\',\'$localhash\',\'${enctype}\',\'${encdata}\')"
|
sqlcommand="INSERT INTO files(backpath,localroot,hash,backupenc,encdata) VALUES(\"${k}\",\"$(pwd)\",\"$localhash\",\"${enctype}\",\"${encdata}\");"
|
||||||
sqlite3 $hashtemp "$sqlcommand"
|
sqlite3 $hashtemp "$sqlcommand"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue