Upgraded from Ubuntu 20.04 to Ubuntu 22.04 using un-requested prompt from Ubuntu to do the upgrade.
I had been running
rsync in a Unix shell script from local pc to locally mounted Samba share on a Raspberry Pi for months and it worked fine. Rsync was using
-aHv options. Client Samba mount was using CIFS. Shortly after upgrading, I noticed that it was taking longer to rsync. I also noticed that there were more files being transferred than were new on the source local pc.
I investigated and found that any files (these are text files using native Ubuntu text editor) created after the Ubuntu 22 upgrade were getting transferred by rsync during every rsync invocation, even if they had not changed. I also found that all the modified times of the transferred files were current time of transfer and not the local source file's modified time.
rsync -aHv --progress <source directory> <target directory>
This only happens for rsync transfers to a remote Samba share locally-mounted. It does not occur when I test transfer files from one local directory to another local directory.
mount -t cifs -o rw,username=<u>,password=<p>,file_mode=0777,dir_mode=0777 //<IP>/<sharedremote> /media/<sharedlocal>
Ubuntu 22.04 version:
:/var/log/apt$ lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 22.04.1 LTS Release: 22.04 Codename: jammy
Probable install date (Aug 16, 2022)
:/var/log/installer$ ls -ltr total 1160 -rw------- 1 root root 956 Sep 2 2016 casper.log -rw------- 1 root root 19 Sep 2 2016 version -rw------- 1 root root 381309 Sep 2 2016 partman -rw------- 1 root root 7112 Sep 2 2016 debug -rw-r--r-- 1 root root 60 Sep 2 2016 media-info -rw-rw-r-- 1 root root 468344 Sep 2 2016 initial-status.gz -rw------- 1 syslog adm 310006 Aug 16 19:46 syslog bruce@bruce-Aspire-E1-572:/var/log/installer$
SAMPLE rsync source and target file ls info for 'bad' rsync remote file transfer:
-rw-rw-r-- 1 bruce bruce 26 Aug 30 10:54 test1.txt
-rwxrwxrwx 1 root root 26 Aug 31 08:23 test1.txt
Hoping this would be enough information to run a test and see if it's happening to others or is something peculiar to my setup. I know enough Ubuntu to be dangerous, but am no expert.
sudodus: thanks for response:
Q: Am I understanding correctly that "during every rsync invocation" means not only the first time after upgrade to 22.04, but every time you run the backup?
A: Yes. Every time the rsync runs, the files get copied and the modified time is updated to current time. Even if the rsync operation is run a few minutes after the first. It seems to be ANY file added after the upgrade and every time after even the first rsync. Files created prior the the upgrade don't get copied (there are hundreds of these).
Q: What operating system (distro and version) are there on the server and the client of the rsync transfer?
Server (Raspberry PI):
$ uname -a Linux pi4nfs 5.10.103-v7l+ #1529 SMP Tue Mar 8 12:24:00 GMT 2022 armv7l GNU/Linux cat /etc/os-release PRETTY_NAME="Raspbian GNU/Linux 10 (buster)" NAME="Raspbian GNU/Linux" VERSION_ID="10" VERSION="10 (buster)" VERSION_CODENAME=buster ID=raspbian ID_LIKE=debian HOME_URL="http://www.raspbian.org/" SUPPORT_URL="http://www.raspbian.org/RaspbianForums" BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs" $ rsync --version rsync version 3.1.3 protocol version 31 Copyright (C) 1996-2018 by Andrew Tridgell, Wayne Davison, and others. Web site: http://rsync.samba.org/ Capabilities: 64-bit files, 64-bit inums, 32-bit timestamps, 64-bit long ints, socketpairs, hardlinks, symlinks, IPv6, batchfiles, inplace, append, ACLs, xattrs, iconv, symtimes, prealloc rsync comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to redistribute it under certain conditions. See the GNU General Public Licence for details.
Ubuntu 22 version:
:/var/log/apt$ lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 22.04.1 LTS Release: 22.04 Codename: jammy $ rsync --version rsync version 3.2.3 protocol version 31 Copyright (C) 1996-2020 by Andrew Tridgell, Wayne Davison, and others. Web site: https://rsync.samba.org/ Capabilities: 64-bit files, 64-bit inums, 64-bit timestamps, 64-bit long ints, socketpairs, hardlinks, hardlink-specials, symlinks, IPv6, atimes, batchfiles, inplace, append, ACLs, xattrs, optional protect-args, iconv, symtimes, prealloc, stop-at, no crtimes Optimizations: SIMD, no asm, openssl-crypto Checksum list: xxh128 xxh3 xxh64 (xxhash) md5 md4 none Compress list: zstd lz4 zlibx zlib none rsync comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to redistribute it under certain conditions. See the GNU General Public Licence for details.
Q; What file system is there on the samba share?
$ df -Th Filesystem Type Size Used Avail Use% Mounted on /dev/root ext4 458G 171G 264G 40% / ....
Q: Would it be possible to access it some other way, for example a 'normal' mount and directly access it via ssh/rsync?
I can try doing via ssh. I've seen info on that, but have not used it.
Q: Are you prepared to modify the options of the rsync command line until you can avoid copying unmodified files with the current method via samba?
Sure. I have a test script that can easily be changed to do that.
== 09.07.22: sudodus workaround worked. Manual run of rsync using ssh target for rsnch (as in @. (I'll check out new-to-me key generation as he suggested). Since I want to put this in automated script which repeats rsync, I needed to embed the password. So this also worked:
sshpass -f ~/. rsync -aHv --progress <local=source-directory>/ @:/
There are issues with having samba-defined ownership nogroup:nobody ownership to deal with, which I can figure out.
HOWEVER, original issue remains: WHAT behavior changed to create my issue? Samba seems to be the culprit as same physical files work as expected with same rsync but using direct ssh access instead of Samba.
== ANOTHER weirdness. In my testing, I started to notice that editing files in my old (non-test folders) local Samba-connected remote files started to give me pop-up notices that 'the file changed on disk' when I'm the only one on this system (it's personal, not corporate). I'll have to narrow this down, but it seems pretty consistent. It would seem that my old file directories are somehow messed up. So far, it's just an annoyance of having to respond to these popups, especially when saving just having re-opened them.