Strange rsync issue - rsync not preserving file times so it keeps re-downloading old stuff

Rob

Administrator
Staff member
Joined
Oct 27, 2011
Messages
1,210
Reaction score
2,240
Credits
3,485
Here's the set up ..

Virtual machine: 'buddy' .. a VM on my Synology NAS
Code:
PRETTY_NAME="Ubuntu 22.04.1 LTS"
NAME="Ubuntu"
VERSION_ID="22.04"
VERSION="22.04.1 LTS (Jammy Jellyfish)"
VERSION_CODENAME=jammy
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=jammy

Laptop: 'main' .. my laptop running pop_os
Code:
NAME="Pop!_OS"
VERSION="22.04 LTS"
ID=pop
ID_LIKE="ubuntu debian"
PRETTY_NAME="Pop!_OS 22.04 LTS"
VERSION_ID="22.04"
HOME_URL="https://pop.system76.com"
SUPPORT_URL="https://support.system76.com"
BUG_REPORT_URL="https://github.com/pop-os/pop/issues"
PRIVACY_POLICY_URL="https://system76.com/privacy"
VERSION_CODENAME=jammy
UBUNTU_CODENAME=jammy
LOGO=distributor-logo-pop-os

The server: Ubuntu 18.04 .. with the backups. They look like this:
Code:
-rw-r--r-- 1 root root 8463482846 Feb 10 00:17 linux_2023_02_10.tgz
-rw-r--r-- 1 root root 8465247672 Feb 11 00:17 linux_2023_02_11.tgz
-rw-r--r-- 1 root root 8471444218 Feb 12 00:17 linux_2023_02_12.tgz
-rw-r--r-- 1 root root 8478096061 Feb 13 00:17 linux_2023_02_13.tgz
-rw-r--r-- 1 root root 8495777571 Feb 14 00:17 linux_2023_02_14.tgz
-rw-r--r-- 1 root root 8498532188 Feb 15 00:17 linux_2023_02_15.tgz

CIFS mount: smb mount on the synology nas .. on ~/synner/
buddy:
Code:
//192.168.86.37/files on /home/rob/synner type cifs (rw,relatime,vers=3.1.1,cache=strict,username=rob,uid=1000,noforceuid,gid=0,noforcegid,addr=192.168.86.37,file_mode=0755,dir_mode=0755,soft,nounix,serverino,mapposix,rsize=4194304,wsize=4194304,bsize=1048576,echo_interval=60,actimeo=1)
main:
Code:
//192.168.86.37/files on /home/rob/synner type cifs (rw,relatime,vers=3.1.1,cache=strict,username=rob,uid=1000,noforceuid,gid=0,noforcegid,addr=192.168.86.37,file_mode=0755,dir_mode=0755,soft,nounix,mapposix,rsize=4194304,wsize=4194304,bsize=1048576,echo_interval=60,actimeo=1,closetimeo=5)

Notice some slight differences here .. buddy has 'serverino' and main has 'closetimeo=5'
- serverino: enable the generation of unique file IDs by the server
- closetimeo: not sure

The backup command:
Code:
/usr/bin/rsync -avz --progress root@kp3:/home/backup/ /home/rob/synner/hosting_backups/kp3/

The issue:
When buddy performs the backups at 6am to the CIFS mount, he saves them with 6am timestamps, so the next day he goes and downloads them all over again even though they haven't changed.

If he writes to a local directory, he'll keep the original (like 00:17) timestamps and not re-download the next day.

So, soemthing wrong with CIFS right? Not so fast .. testing with my laptop (main), he'll preserve the original timestamps regardless of writing locally or to the CIFS mount. They are both mounting the filesystem with the same command here:
sudo mount -t cifs -o username=rob,password=<redacted>,uid=1000 //192.168.86.37/files /home/rob/synner

So, what's going on? They're also both running rsync version 3.2.3 protocol version 31

They also both (buddy and main) have ntp service active and set up identically:
Code:
┌(rob@buddy)─-[~─-
└─$ timedatectl
               Local time: Wed 2023-02-15 11:23:23 EST
           Universal time: Wed 2023-02-15 16:23:23 UTC
                 RTC time: Wed 2023-02-15 16:23:23
                Time zone: America/New_York (EST, -0500)
System clock synchronized: yes
              NTP service: active
          RTC in local TZ: no

┌(rob@main)─-[~─-
└─$ timedatectl
               Local time: Wed 2023-02-15 11:23:34 EST
           Universal time: Wed 2023-02-15 16:23:34 UTC
                 RTC time: Wed 2023-02-15 16:23:34
                Time zone: America/New_York (EST, -0500)
System clock synchronized: yes
              NTP service: active
          RTC in local TZ: no

Both are running version 2:6.14-1ubuntu0.1 of cifs-utils..
 
Last edited:


Quite strange, even though the timestamps are already included in archive mode what happens when you specifically add the following flag to your rsync command, any difference?
Code:
--times, -t              preserve modification times
 
Quite strange, even though the timestamps are already included in archive mode what happens when you specifically add the following flag to your rsync command, any difference?
Code:
--times, -t              preserve modification times

Good idea, just tried, but no change :/
 
Just another thought/idea and something to try, what happens when you sync the files from buddy to your server using rsync with ssh instead of syncing to a locally mounted cifs share folder?
Code:
rsync -avz -e ssh
 
Last edited:
Well, 'server' in this instance is 'kp3' in the backup command, so there's 2 clients, a server and a NAS.

buddy grabs backup files from kp3 and stores them on the cifs mount (NAS). You're thinking the server and cifs mount were the same?

Also, server (kp3) is remote, everyone else is on the local home network.
 
Yeah I was thinking that. In that case what happens when you sync the files that buddy grabs from kp3 to your nas using rsync with ssh instead of rsyncing it to your nas on the locally mounted cifs share directory mounted on buddy?
 
Last edited:

Members online

No members online now.

Top