[Novalug] Backup with rsync
James Ewing Cottrell 3rd
JECottrell3 at Comcast.NET
Thu Jun 17 14:30:14 EDT 2010
On 6/17/2010 8:42 AM, Nino Pereira wrote:
> # Directory to back up to:
> # (this makes the files go to /home/pereira/pereira, for some reason,
> # move them back to /home/pereira/ by going back to /home, and then do
> # 'mv pereira/pereira pereira')
> # REMOTEDIR=/home/pereira
Nino, my boy, I have a flash of Enlightenment for you. Use either a
trailing slash or a trailing /. and you will be fine.
LOCALDIR=/home/pereira # NO
LOCALDIR=/home/pereira/ # YES
LOCALDIR=/home/pereira/. # ALSO OK
I got tired of remembering whether the last component got preserved
under which conditions, so I simply chose to say ".", because in that
case, it works either way.
The manual has a longer discussion on this point.
> # instead, try the following:
> # (Contrary to the documentation, the environment must be
> # given on the command-line of rsync).
> # Set the environment variable RSYNC_RSH
Nope. Perhaps if you are using an old version of rsync on a machine that
uses rsh, like Solaris...then maybe. But remember, rsh almost never
exists on Linux, while ssh does. It is now the default.
Plus, you Never Exported this variable! You either need "export
RSYNC_RSH=rsh" or a "set -a" somewhere, to export all vars.
Root Nino Jim
More information about the Novalug