I am having a p[roblem with using rsync; here are the details.
There are two users in this household: call them john and mary. john and mary each have a desktop system running Ubuntu MATE version 18.04.2. There is also a laptop, also running MATE 18.04.2. When MATE was installed on the laptop, john was the original user; he then added mary as the second user.
Both john and mary would like to keep their laptop /home/xxxx data files in sync with their desktop systems. john uses an rsync script on his desktop (not run as sudo) using commands of this form:
directories:
rsync -e ssh -vaz --delete /home/john/funds/ laptop:/home/john/funds/ 1>>/home/john/backup/laptop.out 2>>/home/john/backup/laptop.error
files:
rsync -e ssh -vaz --delete /home/john/swapfix laptop:/home/john/ 1>>/home/john/backup/laptop.out 2>>/home/john/backup/laptop.error
That works just fine: the files are duly sync'ed with no reported errors.
Mary also uses an rsync script from her desktop with commands just like the above:
rsync -e ssh -vaz --delete /home/mary/funds/ laptop:/home/mary/funds/ 1>>/home/mary/backup/laptop.out 2>>/home/mary/backup/laptop.error
&
rsync -e ssh -vaz --delete /home/mary/swapfix laptop:/home/mary/ 1>>/home/mary/backup/laptop.out 2>>/home/mary/backup/laptop.error
That emphatically does not work. The error-report file is long, and shows entry after entry (but not for every item) with "failed: Permission denied (13)" as well as an occasional "Operation not permitted (1)".
That is what might be called "pushing" the files from the source desktop system to the laptop. What does work, however, is "pulling" the files, using a script on the laptop with commands like these:
rsync -e ssh -vaz --delete lynn@lynn:/home/lynn/funds/ /home/lynn/funds/ 1>>/home/lynn/backup/laptop.out 2>>/home/lynn/backup/laptop.error
&
rsync -e ssh -vaz --delete lynn@lynn:/home/lynn/swapfix /home/lynn/ 1>>/home/lynn/backup/laptop.out 2>>/home/lynn/backup/laptop.error
Using "pull" from the laptop seems to meet the need, but I'd much prefer the two systems to work alike, plus I would like to know why what works for john's desktop won't work for mary's.
(I have run ls -a -l in mary's home directories on both the desktop and the laptop and the permissions seem identical.)
I presume that somehow the rsync on the laptop when it is the remote target does not have authority to write in mary's /home/mary directory, but I am darned if I can see why.
Any help, please?
ssh
from her desktop to the common laptop using Mary's useruname? Are the username for Mary the same in her desktop and the common laptop?id <username>
, check on both machines and compare.