Friday, April 1, 2022

[SOLVED] Why would rsync work perfectly to one computer but not to another when ssh works to both

Issue

The following bash script can be run on computer1 syncing to computer2, but if the destination is computer3, it does not transfer any files.

/usr/bin/rsync -avt --delete --exclude "*.DS_Store" --exclude ".fseventsd" --exclude ".Spotlight-V100" --exclude ".TemporaryItems" --exclude ".Trashes" --log-file=sql.log srcDirectory computer2:backups

The directory backups exists on both computer2 and computer3 in the home directory of the user who is running the command on computer1. ssh to both computer2 and computer3 from computer1 works without requiring a password. The directories are user and group writable. The srcDirectory contains 4 directories daily, weekly, monthly, and yearly. Inside each of these are several mysql dump files. The above command creates the backups/srcDirectory with the four directories and all of the mysql dump files correctly. If, however, the computer2 is replaced with computer3, there is no apparent error and no data is actually transferred. The OS versions on computer1 and computer3 are identical (OS 10.13.6), while the version of the OS on computer2 is 12.2.1.

What could be causing this problem? I've tried using v, vv, and even vvv in the rsync, but still get no hint of an error when it doesn't transfer to computer3.


Solution

I found the problem! The older Mac OS X versions also had a Server version, which I use. When I cloned the computer2 to become computer3, I missed one place where the Ethernet IP address is set in Settings/Network. I had both computers set to the same static IP address of 10.0.1.5. When the lookup was by ip number, they were different as I had changed the copy to 10.0.1.5 from 10.0.1.7, however on the original, I left the reference to the other computer as 10.0.1.5. Thus when I used the local network name of Xanadu.local, it simply pointed back to itself. From the other computer (computer1), it had the correct 10.0.1.5 and 10.0.1.7 for the other computers respectively. Making them correct on computer2 cleared up the problem!

Sometimes, having to go through it to explain what you see to others helps pin down the problem because you have to clearly explain it. Thanks for the forum.



Answered By - John Wooten
Answer Checked By - Marie Seifert (WPSolving Admin)