From 0435efe6155df70e09719b3287b073bc533e6810 Mon Sep 17 00:00:00 2001 From: Michael Rodin Date: Sat, 2 Sep 2023 21:38:47 +0200 Subject: [PATCH] it hopefuully works now --- backup-rclone.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 }