On change detection, can we ignore a size of value 0 for a Google Drive backup

Hallo,

I’m making a backup of Google Drive and each time I run a backup,
the Google Doc files are seen as having being changed because they have a size of 0.

Why ? Because

Is it then possible to not take into account the size 0 in change detection ?

Thanks

More info on my search and analyse

No option to ignore the size
I took a look to the backup command but I just see 2 ignore option

restic backup --help | grep '\-ignore*'
--ignore-ctime                           ignore ctime changes when checking for modified files
--ignore-inode                           ignore inode number and ctime changes when checking for modified files

A restic Dry Run shows 140Mb of change files that are not

using parent snapshot de70ef70

Files:           0 new,   474 changed, 40488 unmodified
Dirs:            0 new,   858 changed,     0 unmodified
Would add to the repository: 141.029 MiB (121.139 MiB stored)

processed 40962 files, 105.019 GiB in 10:16

Size as seen on a Rclone Mount

For instance, the Runway GoogleSheet document is seen with a size of 0

ls -il --block-size=1 --time=ctime /gdrive/Bytle/Run*
9810106213172999484 -rw-r--r-- 1 admin admin 0 May  8  2023 /gdrive/Bytle/Runway.xlsx

A Restic diff shows the content change
When I make a diff, I can see that restic see this file as if the content was changed for each snaphost

restic diff 2b1be0e5 2db48a07
repository 73f0f065 opened (repository version 2) successfully, password is correct
comparing snapshot 2b1be0e5 to 2db48a07:

M    /gdrive/Bytle/Runway.xlsx


Files:           0 new,     0 removed,     ` changed
Dirs:            0 new,     0 removed
Others:          0 new,     0 removed
Data Blobs:      1 new,     1 removed
Tree Blobs:      1 new,     1 removed
  Added:   271.871 KiB
  Removed: 271.856 KiB

Md5 shows the content change
And yes, the md5 is not the same because the files are generated

md5sum /tmp/Run*
cd5bcefef3c0e66f3af0ec766da6a66b  /tmp/Runway-2.xlsx
795ed87a53687ffee7920ec81e97a741  /tmp/Runway.xlsx

So those 0 byte sized files are actually not empty? That is really weird. There’s actually an issue and PR that suggest adding a way to completely ignore those empty files: archiver: Shortcut for handling empty files by greatroar · Pull Request #4267 · restic/restic · GitHub . I’m not really convinced that is a good idea, just like a --ignore-size option feels rather weird.

Does the file date change reliably if the file content change? When ignoring inodes and size, that would be the only remaining change indicator, which leaves a certain risk of not detecting changes of the file content.

The file content actually did change, so diff and the backup statistics just work exactly as they should.

Thanks Mickael!

The size is zero because there is no way to know the size of the generated exported file before exporting it.

And yes, inode and ctime are reliable to detect changes.

Actually, a —ignore-size-0 would do the trick.

I see that there is a skip option, I will try to make 2 job one for Google docs and one for other format.