rsync is failing with confusing error messages

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
1
down vote

favorite












In a bash script (Arch Linux) I have the following rsync command:



rsync –nvaAHX --inplace --delete-delay --exclude-from="/etc/$path1/exclude-list-$configName.txt" "$new_snap/" "$BACKUPDIR"


The rsync command fails with the following error:



rsync: --delete does not work without --recursive (-r) or --dirs (-d).


Of course, that message is misleading as "a" implies "r".



If I remove the option "--delete-delay" from the rsync command, I get this different error:



rsync: link_stat "/some/path/–aAHX" failed: No such file or directory (2)


The value shown at "/some/path" is the current working directory. If I change the current directory, that value in the error message changes as well. However, why the options "-aAHX" would be appended to any part of the path is confusing.



The computer is a fully updated Arch Linux system. I just rebooted it as well.



4.13.11-1-ARCH #1 SMP PREEMPT Thu Nov 2 10:25:56 CET 2017 x86_64 GNU/Linux


rsync program location:



# which rsync
/usr/bin/rsync


Here is the test script:



#!/bin/bash

path1=xyz
configName=root
new_snap=/.snapshots/1/snapshot
BACKUPDIR=/backup/$configName

echo "showing exclude file contents:"

cat "/etc/$path1/exclude-list-$configName.txt"

echo

echo rsync –nvaAHX --inplace --delete-delay --exclude-from="/etc/$path1/exclude-list-$configName.txt" "$new_snap/" "$BACKUPDIR"

rsync –nvaAHX --inplace --delete-delay --exclude-from="/etc/$path1/exclude-list-$configName.txt" "$new_snap/" "$BACKUPDIR"


Here are the contents of the file "/etc/$path/exclude-list-$configName.txt":



"dev/*"
"proc/*"
"sys/*"
"tmp/*"
"run/*"
"mnt/*"
"media/*"
"lost+found"
".trash*/*"
".Trash*/*"


Here is some testing without any script at all. I find it baffling.



# mkdir adir
# mkdir bdir
# touch adir/afile1
# touch adir/afile2

# ls -la adir/
total 0
drwxr-x--x 1 root root 24 Nov 12 02:21 .
drwxr-xr-x 1 user user 2080 Nov 12 02:28 ..
-rw-r----- 1 root root 0 Nov 12 02:21 afile1
-rw-r----- 1 root root 0 Nov 12 02:21 afile2
# ls -la bdir/
total 0
drwxr-x--x 1 root root 0 Nov 12 02:21 .
drwxr-xr-x 1 user user 2080 Nov 12 02:28 ..


# rsync -nva adir/ bdir
sending incremental file list
./
afile1
afile2

sent 93 bytes received 25 bytes 236.00 bytes/sec
total size is 0 speedup is 0.00 (DRY RUN)

# rsync -nva /home/user/adir/ /home/user/bdir
sending incremental file list
./
afile1
afile2

sent 93 bytes received 25 bytes 236.00 bytes/sec
total size is 0 speedup is 0.00 (DRY RUN)


# rsync –nvaAHX --inplace --delete-delay --exclude-from=/root/exclude-list-root.txt /home/user/adir/ /home/user/bdir/
rsync: --delete does not work without --recursive (-r) or --dirs (-d).
rsync error: syntax or usage error (code 1) at main.c(1567) [client=3.1.2]
# rsync –nvaAHX --inplace --delete-delay /home/user/adir/ /home/user/bdir/
rsync: --delete does not work without --recursive (-r) or --dirs (-d).
rsync error: syntax or usage error (code 1) at main.c(1567) [client=3.1.2]
# rsync –nvaAHX --inplace /home/user/adir/ /home/user/bdir/
rsync: link_stat "/home/user/–nvaAHX" failed: No such file or directory (2)
skipping directory .
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1178) [sender=3.1.2]
# rsync –nvaAHX /home/user/adir/ /home/user/bdir/
rsync: link_stat "/home/user/–nvaAHX" failed: No such file or directory (2)
skipping directory .
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1178) [sender=3.1.2]
# rsync –nva /home/user/adir/ /home/user/bdir/
rsync: link_stat "/home/user/–nva" failed: No such file or directory (2)
skipping directory .
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1178) [sender=3.1.2]






share|improve this question






















  • Why would you choose $path as a variable name? And how is it set?
    – jasonwryan
    Nov 12 '17 at 6:34











  • @jasonwryan Looks like it's just a typo...all other references are to $path1.
    – B Layer
    Nov 12 '17 at 7:25











  • Do you happen to have rsync as an alias or shell function in your working environment, or is it the name of a script that you have written?
    – Kusalananda
    Nov 12 '17 at 7:27











  • UPDATED the question. Fixed the typo. I do not have rsync or anything close to that as an alias. I have not written any scripts with this name either.
    – MountainX
    Nov 12 '17 at 7:53














up vote
1
down vote

favorite












In a bash script (Arch Linux) I have the following rsync command:



rsync –nvaAHX --inplace --delete-delay --exclude-from="/etc/$path1/exclude-list-$configName.txt" "$new_snap/" "$BACKUPDIR"


The rsync command fails with the following error:



rsync: --delete does not work without --recursive (-r) or --dirs (-d).


Of course, that message is misleading as "a" implies "r".



If I remove the option "--delete-delay" from the rsync command, I get this different error:



rsync: link_stat "/some/path/–aAHX" failed: No such file or directory (2)


The value shown at "/some/path" is the current working directory. If I change the current directory, that value in the error message changes as well. However, why the options "-aAHX" would be appended to any part of the path is confusing.



The computer is a fully updated Arch Linux system. I just rebooted it as well.



4.13.11-1-ARCH #1 SMP PREEMPT Thu Nov 2 10:25:56 CET 2017 x86_64 GNU/Linux


rsync program location:



# which rsync
/usr/bin/rsync


Here is the test script:



#!/bin/bash

path1=xyz
configName=root
new_snap=/.snapshots/1/snapshot
BACKUPDIR=/backup/$configName

echo "showing exclude file contents:"

cat "/etc/$path1/exclude-list-$configName.txt"

echo

echo rsync –nvaAHX --inplace --delete-delay --exclude-from="/etc/$path1/exclude-list-$configName.txt" "$new_snap/" "$BACKUPDIR"

rsync –nvaAHX --inplace --delete-delay --exclude-from="/etc/$path1/exclude-list-$configName.txt" "$new_snap/" "$BACKUPDIR"


Here are the contents of the file "/etc/$path/exclude-list-$configName.txt":



"dev/*"
"proc/*"
"sys/*"
"tmp/*"
"run/*"
"mnt/*"
"media/*"
"lost+found"
".trash*/*"
".Trash*/*"


Here is some testing without any script at all. I find it baffling.



# mkdir adir
# mkdir bdir
# touch adir/afile1
# touch adir/afile2

# ls -la adir/
total 0
drwxr-x--x 1 root root 24 Nov 12 02:21 .
drwxr-xr-x 1 user user 2080 Nov 12 02:28 ..
-rw-r----- 1 root root 0 Nov 12 02:21 afile1
-rw-r----- 1 root root 0 Nov 12 02:21 afile2
# ls -la bdir/
total 0
drwxr-x--x 1 root root 0 Nov 12 02:21 .
drwxr-xr-x 1 user user 2080 Nov 12 02:28 ..


# rsync -nva adir/ bdir
sending incremental file list
./
afile1
afile2

sent 93 bytes received 25 bytes 236.00 bytes/sec
total size is 0 speedup is 0.00 (DRY RUN)

# rsync -nva /home/user/adir/ /home/user/bdir
sending incremental file list
./
afile1
afile2

sent 93 bytes received 25 bytes 236.00 bytes/sec
total size is 0 speedup is 0.00 (DRY RUN)


# rsync –nvaAHX --inplace --delete-delay --exclude-from=/root/exclude-list-root.txt /home/user/adir/ /home/user/bdir/
rsync: --delete does not work without --recursive (-r) or --dirs (-d).
rsync error: syntax or usage error (code 1) at main.c(1567) [client=3.1.2]
# rsync –nvaAHX --inplace --delete-delay /home/user/adir/ /home/user/bdir/
rsync: --delete does not work without --recursive (-r) or --dirs (-d).
rsync error: syntax or usage error (code 1) at main.c(1567) [client=3.1.2]
# rsync –nvaAHX --inplace /home/user/adir/ /home/user/bdir/
rsync: link_stat "/home/user/–nvaAHX" failed: No such file or directory (2)
skipping directory .
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1178) [sender=3.1.2]
# rsync –nvaAHX /home/user/adir/ /home/user/bdir/
rsync: link_stat "/home/user/–nvaAHX" failed: No such file or directory (2)
skipping directory .
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1178) [sender=3.1.2]
# rsync –nva /home/user/adir/ /home/user/bdir/
rsync: link_stat "/home/user/–nva" failed: No such file or directory (2)
skipping directory .
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1178) [sender=3.1.2]






share|improve this question






















  • Why would you choose $path as a variable name? And how is it set?
    – jasonwryan
    Nov 12 '17 at 6:34











  • @jasonwryan Looks like it's just a typo...all other references are to $path1.
    – B Layer
    Nov 12 '17 at 7:25











  • Do you happen to have rsync as an alias or shell function in your working environment, or is it the name of a script that you have written?
    – Kusalananda
    Nov 12 '17 at 7:27











  • UPDATED the question. Fixed the typo. I do not have rsync or anything close to that as an alias. I have not written any scripts with this name either.
    – MountainX
    Nov 12 '17 at 7:53












up vote
1
down vote

favorite









up vote
1
down vote

favorite











In a bash script (Arch Linux) I have the following rsync command:



rsync –nvaAHX --inplace --delete-delay --exclude-from="/etc/$path1/exclude-list-$configName.txt" "$new_snap/" "$BACKUPDIR"


The rsync command fails with the following error:



rsync: --delete does not work without --recursive (-r) or --dirs (-d).


Of course, that message is misleading as "a" implies "r".



If I remove the option "--delete-delay" from the rsync command, I get this different error:



rsync: link_stat "/some/path/–aAHX" failed: No such file or directory (2)


The value shown at "/some/path" is the current working directory. If I change the current directory, that value in the error message changes as well. However, why the options "-aAHX" would be appended to any part of the path is confusing.



The computer is a fully updated Arch Linux system. I just rebooted it as well.



4.13.11-1-ARCH #1 SMP PREEMPT Thu Nov 2 10:25:56 CET 2017 x86_64 GNU/Linux


rsync program location:



# which rsync
/usr/bin/rsync


Here is the test script:



#!/bin/bash

path1=xyz
configName=root
new_snap=/.snapshots/1/snapshot
BACKUPDIR=/backup/$configName

echo "showing exclude file contents:"

cat "/etc/$path1/exclude-list-$configName.txt"

echo

echo rsync –nvaAHX --inplace --delete-delay --exclude-from="/etc/$path1/exclude-list-$configName.txt" "$new_snap/" "$BACKUPDIR"

rsync –nvaAHX --inplace --delete-delay --exclude-from="/etc/$path1/exclude-list-$configName.txt" "$new_snap/" "$BACKUPDIR"


Here are the contents of the file "/etc/$path/exclude-list-$configName.txt":



"dev/*"
"proc/*"
"sys/*"
"tmp/*"
"run/*"
"mnt/*"
"media/*"
"lost+found"
".trash*/*"
".Trash*/*"


Here is some testing without any script at all. I find it baffling.



# mkdir adir
# mkdir bdir
# touch adir/afile1
# touch adir/afile2

# ls -la adir/
total 0
drwxr-x--x 1 root root 24 Nov 12 02:21 .
drwxr-xr-x 1 user user 2080 Nov 12 02:28 ..
-rw-r----- 1 root root 0 Nov 12 02:21 afile1
-rw-r----- 1 root root 0 Nov 12 02:21 afile2
# ls -la bdir/
total 0
drwxr-x--x 1 root root 0 Nov 12 02:21 .
drwxr-xr-x 1 user user 2080 Nov 12 02:28 ..


# rsync -nva adir/ bdir
sending incremental file list
./
afile1
afile2

sent 93 bytes received 25 bytes 236.00 bytes/sec
total size is 0 speedup is 0.00 (DRY RUN)

# rsync -nva /home/user/adir/ /home/user/bdir
sending incremental file list
./
afile1
afile2

sent 93 bytes received 25 bytes 236.00 bytes/sec
total size is 0 speedup is 0.00 (DRY RUN)


# rsync –nvaAHX --inplace --delete-delay --exclude-from=/root/exclude-list-root.txt /home/user/adir/ /home/user/bdir/
rsync: --delete does not work without --recursive (-r) or --dirs (-d).
rsync error: syntax or usage error (code 1) at main.c(1567) [client=3.1.2]
# rsync –nvaAHX --inplace --delete-delay /home/user/adir/ /home/user/bdir/
rsync: --delete does not work without --recursive (-r) or --dirs (-d).
rsync error: syntax or usage error (code 1) at main.c(1567) [client=3.1.2]
# rsync –nvaAHX --inplace /home/user/adir/ /home/user/bdir/
rsync: link_stat "/home/user/–nvaAHX" failed: No such file or directory (2)
skipping directory .
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1178) [sender=3.1.2]
# rsync –nvaAHX /home/user/adir/ /home/user/bdir/
rsync: link_stat "/home/user/–nvaAHX" failed: No such file or directory (2)
skipping directory .
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1178) [sender=3.1.2]
# rsync –nva /home/user/adir/ /home/user/bdir/
rsync: link_stat "/home/user/–nva" failed: No such file or directory (2)
skipping directory .
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1178) [sender=3.1.2]






share|improve this question














In a bash script (Arch Linux) I have the following rsync command:



rsync –nvaAHX --inplace --delete-delay --exclude-from="/etc/$path1/exclude-list-$configName.txt" "$new_snap/" "$BACKUPDIR"


The rsync command fails with the following error:



rsync: --delete does not work without --recursive (-r) or --dirs (-d).


Of course, that message is misleading as "a" implies "r".



If I remove the option "--delete-delay" from the rsync command, I get this different error:



rsync: link_stat "/some/path/–aAHX" failed: No such file or directory (2)


The value shown at "/some/path" is the current working directory. If I change the current directory, that value in the error message changes as well. However, why the options "-aAHX" would be appended to any part of the path is confusing.



The computer is a fully updated Arch Linux system. I just rebooted it as well.



4.13.11-1-ARCH #1 SMP PREEMPT Thu Nov 2 10:25:56 CET 2017 x86_64 GNU/Linux


rsync program location:



# which rsync
/usr/bin/rsync


Here is the test script:



#!/bin/bash

path1=xyz
configName=root
new_snap=/.snapshots/1/snapshot
BACKUPDIR=/backup/$configName

echo "showing exclude file contents:"

cat "/etc/$path1/exclude-list-$configName.txt"

echo

echo rsync –nvaAHX --inplace --delete-delay --exclude-from="/etc/$path1/exclude-list-$configName.txt" "$new_snap/" "$BACKUPDIR"

rsync –nvaAHX --inplace --delete-delay --exclude-from="/etc/$path1/exclude-list-$configName.txt" "$new_snap/" "$BACKUPDIR"


Here are the contents of the file "/etc/$path/exclude-list-$configName.txt":



"dev/*"
"proc/*"
"sys/*"
"tmp/*"
"run/*"
"mnt/*"
"media/*"
"lost+found"
".trash*/*"
".Trash*/*"


Here is some testing without any script at all. I find it baffling.



# mkdir adir
# mkdir bdir
# touch adir/afile1
# touch adir/afile2

# ls -la adir/
total 0
drwxr-x--x 1 root root 24 Nov 12 02:21 .
drwxr-xr-x 1 user user 2080 Nov 12 02:28 ..
-rw-r----- 1 root root 0 Nov 12 02:21 afile1
-rw-r----- 1 root root 0 Nov 12 02:21 afile2
# ls -la bdir/
total 0
drwxr-x--x 1 root root 0 Nov 12 02:21 .
drwxr-xr-x 1 user user 2080 Nov 12 02:28 ..


# rsync -nva adir/ bdir
sending incremental file list
./
afile1
afile2

sent 93 bytes received 25 bytes 236.00 bytes/sec
total size is 0 speedup is 0.00 (DRY RUN)

# rsync -nva /home/user/adir/ /home/user/bdir
sending incremental file list
./
afile1
afile2

sent 93 bytes received 25 bytes 236.00 bytes/sec
total size is 0 speedup is 0.00 (DRY RUN)


# rsync –nvaAHX --inplace --delete-delay --exclude-from=/root/exclude-list-root.txt /home/user/adir/ /home/user/bdir/
rsync: --delete does not work without --recursive (-r) or --dirs (-d).
rsync error: syntax or usage error (code 1) at main.c(1567) [client=3.1.2]
# rsync –nvaAHX --inplace --delete-delay /home/user/adir/ /home/user/bdir/
rsync: --delete does not work without --recursive (-r) or --dirs (-d).
rsync error: syntax or usage error (code 1) at main.c(1567) [client=3.1.2]
# rsync –nvaAHX --inplace /home/user/adir/ /home/user/bdir/
rsync: link_stat "/home/user/–nvaAHX" failed: No such file or directory (2)
skipping directory .
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1178) [sender=3.1.2]
# rsync –nvaAHX /home/user/adir/ /home/user/bdir/
rsync: link_stat "/home/user/–nvaAHX" failed: No such file or directory (2)
skipping directory .
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1178) [sender=3.1.2]
# rsync –nva /home/user/adir/ /home/user/bdir/
rsync: link_stat "/home/user/–nva" failed: No such file or directory (2)
skipping directory .
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1178) [sender=3.1.2]








share|improve this question













share|improve this question




share|improve this question








edited Nov 12 '17 at 15:07









Jeff Schaller

32k849109




32k849109










asked Nov 12 '17 at 4:39









MountainX

4,4862367117




4,4862367117











  • Why would you choose $path as a variable name? And how is it set?
    – jasonwryan
    Nov 12 '17 at 6:34











  • @jasonwryan Looks like it's just a typo...all other references are to $path1.
    – B Layer
    Nov 12 '17 at 7:25











  • Do you happen to have rsync as an alias or shell function in your working environment, or is it the name of a script that you have written?
    – Kusalananda
    Nov 12 '17 at 7:27











  • UPDATED the question. Fixed the typo. I do not have rsync or anything close to that as an alias. I have not written any scripts with this name either.
    – MountainX
    Nov 12 '17 at 7:53
















  • Why would you choose $path as a variable name? And how is it set?
    – jasonwryan
    Nov 12 '17 at 6:34











  • @jasonwryan Looks like it's just a typo...all other references are to $path1.
    – B Layer
    Nov 12 '17 at 7:25











  • Do you happen to have rsync as an alias or shell function in your working environment, or is it the name of a script that you have written?
    – Kusalananda
    Nov 12 '17 at 7:27











  • UPDATED the question. Fixed the typo. I do not have rsync or anything close to that as an alias. I have not written any scripts with this name either.
    – MountainX
    Nov 12 '17 at 7:53















Why would you choose $path as a variable name? And how is it set?
– jasonwryan
Nov 12 '17 at 6:34





Why would you choose $path as a variable name? And how is it set?
– jasonwryan
Nov 12 '17 at 6:34













@jasonwryan Looks like it's just a typo...all other references are to $path1.
– B Layer
Nov 12 '17 at 7:25





@jasonwryan Looks like it's just a typo...all other references are to $path1.
– B Layer
Nov 12 '17 at 7:25













Do you happen to have rsync as an alias or shell function in your working environment, or is it the name of a script that you have written?
– Kusalananda
Nov 12 '17 at 7:27





Do you happen to have rsync as an alias or shell function in your working environment, or is it the name of a script that you have written?
– Kusalananda
Nov 12 '17 at 7:27













UPDATED the question. Fixed the typo. I do not have rsync or anything close to that as an alias. I have not written any scripts with this name either.
– MountainX
Nov 12 '17 at 7:53




UPDATED the question. Fixed the typo. I do not have rsync or anything close to that as an alias. I have not written any scripts with this name either.
– MountainX
Nov 12 '17 at 7:53










2 Answers
2






active

oldest

votes

















up vote
5
down vote



accepted










That dash in front of n in –nvaHAX is not an ordinary dash but a slightly longer em-dash (or hyphen).



This may have happened if you're copy and pasting from a "smart" editor or word processor that replaces certain characters with the corresponding typographical character.



On my system, copying and pasting the first part of your command results in:



$ rsync –nva adir/ bdir/ 
rsync: link_stat "/tmp_mfs/shell-ksh.D1Mq1Xht/#342#200#223nva" failed: No such file or directory (2)
skipping directory .
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1178) [sender=3.1.2]


As you can see, my terminal displays the error message slightly differently from yours and shows that the dash is in fact a Unicode character (or something similar, I don't know much about character encodings).






share|improve this answer




















  • Thank you. Looks like I was posting an answer at the same time as you. I accepted your answer.
    – MountainX
    Nov 12 '17 at 8:15










  • Nice catch! Eagle-vision!!!
    – maulinglawns
    Nov 12 '17 at 8:43

















up vote
1
down vote













The whole strange problem was caused by the character in front of the rsync options. The problematic character is this one (and I don't know how it got there):



–
# printf – | od -An -vtu1
226 128 147


The proper character is this character, a standard dash (minus sign):



-
# printf - | od -An -vtu1
45





share|improve this answer




















    Your Answer







    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "106"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    convertImagesToLinks: false,
    noModals: false,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













     

    draft saved


    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f403983%2frsync-is-failing-with-confusing-error-messages%23new-answer', 'question_page');

    );

    Post as a guest






























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    5
    down vote



    accepted










    That dash in front of n in –nvaHAX is not an ordinary dash but a slightly longer em-dash (or hyphen).



    This may have happened if you're copy and pasting from a "smart" editor or word processor that replaces certain characters with the corresponding typographical character.



    On my system, copying and pasting the first part of your command results in:



    $ rsync –nva adir/ bdir/ 
    rsync: link_stat "/tmp_mfs/shell-ksh.D1Mq1Xht/#342#200#223nva" failed: No such file or directory (2)
    skipping directory .
    rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1178) [sender=3.1.2]


    As you can see, my terminal displays the error message slightly differently from yours and shows that the dash is in fact a Unicode character (or something similar, I don't know much about character encodings).






    share|improve this answer




















    • Thank you. Looks like I was posting an answer at the same time as you. I accepted your answer.
      – MountainX
      Nov 12 '17 at 8:15










    • Nice catch! Eagle-vision!!!
      – maulinglawns
      Nov 12 '17 at 8:43














    up vote
    5
    down vote



    accepted










    That dash in front of n in –nvaHAX is not an ordinary dash but a slightly longer em-dash (or hyphen).



    This may have happened if you're copy and pasting from a "smart" editor or word processor that replaces certain characters with the corresponding typographical character.



    On my system, copying and pasting the first part of your command results in:



    $ rsync –nva adir/ bdir/ 
    rsync: link_stat "/tmp_mfs/shell-ksh.D1Mq1Xht/#342#200#223nva" failed: No such file or directory (2)
    skipping directory .
    rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1178) [sender=3.1.2]


    As you can see, my terminal displays the error message slightly differently from yours and shows that the dash is in fact a Unicode character (or something similar, I don't know much about character encodings).






    share|improve this answer




















    • Thank you. Looks like I was posting an answer at the same time as you. I accepted your answer.
      – MountainX
      Nov 12 '17 at 8:15










    • Nice catch! Eagle-vision!!!
      – maulinglawns
      Nov 12 '17 at 8:43












    up vote
    5
    down vote



    accepted







    up vote
    5
    down vote



    accepted






    That dash in front of n in –nvaHAX is not an ordinary dash but a slightly longer em-dash (or hyphen).



    This may have happened if you're copy and pasting from a "smart" editor or word processor that replaces certain characters with the corresponding typographical character.



    On my system, copying and pasting the first part of your command results in:



    $ rsync –nva adir/ bdir/ 
    rsync: link_stat "/tmp_mfs/shell-ksh.D1Mq1Xht/#342#200#223nva" failed: No such file or directory (2)
    skipping directory .
    rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1178) [sender=3.1.2]


    As you can see, my terminal displays the error message slightly differently from yours and shows that the dash is in fact a Unicode character (or something similar, I don't know much about character encodings).






    share|improve this answer












    That dash in front of n in –nvaHAX is not an ordinary dash but a slightly longer em-dash (or hyphen).



    This may have happened if you're copy and pasting from a "smart" editor or word processor that replaces certain characters with the corresponding typographical character.



    On my system, copying and pasting the first part of your command results in:



    $ rsync –nva adir/ bdir/ 
    rsync: link_stat "/tmp_mfs/shell-ksh.D1Mq1Xht/#342#200#223nva" failed: No such file or directory (2)
    skipping directory .
    rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1178) [sender=3.1.2]


    As you can see, my terminal displays the error message slightly differently from yours and shows that the dash is in fact a Unicode character (or something similar, I don't know much about character encodings).







    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered Nov 12 '17 at 8:03









    Kusalananda

    105k14207325




    105k14207325











    • Thank you. Looks like I was posting an answer at the same time as you. I accepted your answer.
      – MountainX
      Nov 12 '17 at 8:15










    • Nice catch! Eagle-vision!!!
      – maulinglawns
      Nov 12 '17 at 8:43
















    • Thank you. Looks like I was posting an answer at the same time as you. I accepted your answer.
      – MountainX
      Nov 12 '17 at 8:15










    • Nice catch! Eagle-vision!!!
      – maulinglawns
      Nov 12 '17 at 8:43















    Thank you. Looks like I was posting an answer at the same time as you. I accepted your answer.
    – MountainX
    Nov 12 '17 at 8:15




    Thank you. Looks like I was posting an answer at the same time as you. I accepted your answer.
    – MountainX
    Nov 12 '17 at 8:15












    Nice catch! Eagle-vision!!!
    – maulinglawns
    Nov 12 '17 at 8:43




    Nice catch! Eagle-vision!!!
    – maulinglawns
    Nov 12 '17 at 8:43












    up vote
    1
    down vote













    The whole strange problem was caused by the character in front of the rsync options. The problematic character is this one (and I don't know how it got there):



    –
    # printf – | od -An -vtu1
    226 128 147


    The proper character is this character, a standard dash (minus sign):



    -
    # printf - | od -An -vtu1
    45





    share|improve this answer
























      up vote
      1
      down vote













      The whole strange problem was caused by the character in front of the rsync options. The problematic character is this one (and I don't know how it got there):



      –
      # printf – | od -An -vtu1
      226 128 147


      The proper character is this character, a standard dash (minus sign):



      -
      # printf - | od -An -vtu1
      45





      share|improve this answer






















        up vote
        1
        down vote










        up vote
        1
        down vote









        The whole strange problem was caused by the character in front of the rsync options. The problematic character is this one (and I don't know how it got there):



        –
        # printf – | od -An -vtu1
        226 128 147


        The proper character is this character, a standard dash (minus sign):



        -
        # printf - | od -An -vtu1
        45





        share|improve this answer












        The whole strange problem was caused by the character in front of the rsync options. The problematic character is this one (and I don't know how it got there):



        –
        # printf – | od -An -vtu1
        226 128 147


        The proper character is this character, a standard dash (minus sign):



        -
        # printf - | od -An -vtu1
        45






        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 12 '17 at 8:13









        MountainX

        4,4862367117




        4,4862367117



























             

            draft saved


            draft discarded















































             


            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f403983%2frsync-is-failing-with-confusing-error-messages%23new-answer', 'question_page');

            );

            Post as a guest













































































            Popular posts from this blog

            How to check contact read email or not when send email to Individual?

            Bahrain

            Postfix configuration issue with fips on centos 7; mailgun relay