diff --git a/backup.sh b/backup.sh
index 536d690dec54f917d5fbdaf1a9ec35d0749759b3..056e5d68b887f4b03ed28d52450749eced3c7ab4 100755
--- a/backup.sh
+++ b/backup.sh
@@ -173,7 +173,7 @@ done <<< "$files"
 
 #Try to make a patch of the database dump
 file="db-dumps/mysql-snipeit.sql"
-if [ -z "$(ls -A "$destinationDir/$lastBackup/patches")" ]; then
+if [ -z "$(ls -Ap "$destinationDir/$lastBackup/patches" | grep -v /)" ]; then
     diff -urN null $file > patch.patch
     cp "patch.patch" "$destinationDir/$lastBackup/patches/$now.patch"
     echo "Copied patch to $destinationDir/$lastBackup/patches/$now.patch"