diff --git a/backup-rclone.sh b/backup-rclone.sh index 6ec56b4..70102d3 100755 --- a/backup-rclone.sh +++ b/backup-rclone.sh @@ -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 draw_progress $(($progress)) "$k" "$action" #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 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 @@ -64,7 +64,7 @@ backup() { # backup 1: 2: else if [[ "$enctype" == "gpg" ]]; then encdata="$RECIPIENT_ID" 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" fi }