I'm trying to use rsync to make a remote dir identical to my local version, so I do something like (with the "my" stuff below suitably replaced)

rsync -avhe 'ssh -p 7822' --progress --delete  \
    /mylocaldir myusername@myremotehost:~/myremotedir`

The output of the command indicates warnings but no error message :

perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
    LANGUAGE = (unset),
    LC_ALL = (unset),
    LC_NUMERIC = "c",
    LANG = "fr_FR.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
building file list ... 
70 files to consider
         582 100%    0.00kB/s    0:00:00 (xfer#1, to-check=67/70)

sent 2.28K bytes  received 48 bytes  665.71 bytes/sec
total size is 919.11K  speedup is 394.47

But when I check on the remote dir, nothing has been updated. I tried it several times. What is happening here ? Any help appreciated.

Update, in answer to the first comment below : here is the content of my /etc/profile file :

# System-wide .profile for sh(1)

if [ -x /usr/libexec/path_helper ]; then
    eval `/usr/libexec/path_helper -s`

if [ "${BASH-no}" != "no" ]; then
    [ -r /etc/bashrc ] && . /etc/bashrc
  • 1
    You have commands in your /etc/profile (or whatever) that produce output when run in non-interactive shells. This breaks the rsync protocol. Basically you need to identify those commands, and run them only when $- contains i. Sep 25, 2017 at 8:36
  • @SatōKatsura When i do echo $-, I get himBH, so my $- does contain i. Sep 25, 2017 at 8:44
  • Your $- does contain i in interactive shells. This doesn't happen when the (remote) shell is run from rsync. Sep 25, 2017 at 8:45
  • @SatōKatsura So, in your above comment you meant the remote /etc/profile , not the local one ? Sep 25, 2017 at 8:50
  • I'm referring to something in the startup sequence of your remote shell. That might be /etc/profile or some other config file. Sep 25, 2017 at 8:54

1 Answer 1


rsync is running, so the locale error message is not critical. Instead, I suspect that your two directory definitions are not quite what you want, and you may be looking in the wrong place for the files.

You have a source /mylocaldir and a destination ~/myremotedir. This will create ~/myremotedir/mylocaldir on the target, and that's where the files will be placed.

If you want the contents of /mylocaldir to be copied to ~/myremotedir you need to provide a trailing / on the source directory, like this:

rsync -avh -e 'ssh -p 7822' --progress --delete \
    /mylocaldir/ myusername@myremotehost:myremotedir

NB I've split the command over two lines for readability. As written it's valid shell syntax, but remove the \ character on the end of the first line and join them together if you prefer.

The perl error message about locales will be coming from some program that's executed as part of your login process. It might be path_helper, which seems to be a MacOS application so I can't advise you on the importance or otherwise of commenting it out, or it could be something in /etc/bashrc.

Rather than trying to identify the offending application, another option, of course, is to install the French locale files on your target system, so that the error is no longer triggered.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .