Unquoted variables are the bug I see most, and shellcheck spots them in a second.
shellcheck backup.sh
shellcheck -x -s bash backup.sh
shellcheck reports each problem with a code like SC2086 and a link to a page that explains the fix. -s bash sets the dialect when there is no shebang, and -x follows files loaded with source. Install it with apt install shellcheck. A line like # shellcheck disable=SC2086 silences one warning when you are sure.
Further reading: ShellCheck wiki: SC2086