Your .profile
is only read when you log in interactively. When rsync connects to another machine to execute a command, /etc/profile
and ~/.profile
are not read.
If your login shell is bash, then ~/.bashrc
may be read (this is a quirk of bash — ~/.bashrc
is read by non-login interactive shells, and in some circumstances by login non-interactive shells). This doesn't apply to all versions of bash though.
The easiest way to make rsync work is probably to pass the --rsync-path
option, e.g.
rsync --rsync-path=/home/elbarna/bin/rsync -avP /home/user/.profile hpux3:/home/user/.profile
If you log in over SSH with key-based authentication, you can set the PATH
environment variable via your ~/.ssh/authorized_keys
. See sh startup files over ssh for explanations of how to arrange to load .profile
when logging in over SSH with a key.
rsync
command must be present on your local machine. – ott-- Apr 26 '15 at 21:44