0

I have a Rasberry PI where I have mounted a QNAP share.

This is how it is mounted in /etc/fstab on the PI:

//192.168.1.130/Backup/Icloud /home/pi/IcloudPictures cifs username=admin,password=masked,uid=1000,gid=1000

The mount works fine and I can read and write files.

I use rsync on the PI to extract some photos from one folder in the mount point to another folder in the mount point - e.g.:

rsync -av --include="*/" --include="*.jpg" --exclude="*" /home/pi/IcloudPictures/source/ /home/pi/IcloudPictures/filtered/

When I use -a it will implicit use -t which preserves timestamp - but the issue is that the timestamp of the file in the filtered folder does not get preserved from the source. It gets the current time as the timestamp.

This means that rsync will copy all files each time because the timestamp does not match. I can use --size-only to skip time check, but that has its negative sides as well.

Why is the timestamp not preserved? Have I mounted the folder incorrectly?

Ziggy000
  • 1
  • 1
  • 1
    `-av` would be more typical for bundled short options than your `--av` – thrig Sep 03 '22 at 19:56
  • There was a typo. I am using -av and not --av. – Ziggy000 Sep 04 '22 at 06:17
  • I did some more testeing. If I run with the --size-only flag it actually updates the modified time of the destination file. But if I run with -a or -t it does not update. Is this a bug in rsync on the Raspberry PI? – Ziggy000 Sep 04 '22 at 06:19
  • The clocks on the Pi and the QNAP match? – roaima Sep 04 '22 at 06:35
  • Yes, the clocks match. And as I write, if I run with the --size-only flag it actually updates the modified time correctly. I read somewhere about a bug in Samba on this - maybe I should try to upgrade to newer Raspberry Pi OS... – Ziggy000 Sep 04 '22 at 09:44
  • Ziggy000 I have a Pi and a QNAP, have tested this but cannot reproduce the issue. Pi `rsync` version 3.1.3 protocol 31. QNAP QTS version 5.0.0.2055 (and about to update it for a recent CVE) – roaima Sep 06 '22 at 17:30
  • Do you have a `~/.popt` file? If so please add its contents to your question. I suspect that if you do there'll be something counteracting `-t` (`--times`) in there. – roaima Sep 06 '22 at 17:50
  • I see that I have rsync 3.1.2 (same protocol). I do not have a .popt file. I changed to doing the rsync directly in the QNAP instead and that works perfectly. I think I will upgrade from Buster to Bullseye on the pi and test with that. There are some threads about bugs in Samba affecting mtime, and maybe that is the issue here... https://bugzilla.kernel.org/show_bug.cgi?id=198967 – Ziggy000 Sep 07 '22 at 19:06
  • I also find this that suggests a bug in rsync 3.1.2 https://bugzilla.redhat.com/show_bug.cgi?id=1672779 – Ziggy000 Sep 07 '22 at 19:12
  • Upgraded to rsync 3.1.3 but still same issue. Roaima: Do you have both source and destination on the same Samba share? That is what I have. – Ziggy000 Sep 07 '22 at 19:18

0 Answers0