6

I'm trying to migrate centos server to a new box with rsync and I run this command in the destination server:

 rsync -auHxv –numeric-ids –exclude=/etc/fstab
 –exclude=/etc/sysconfig/network-scripts/* –exclude=/proc/*
 –exclude=/tmp/* –exclude=/sys/* –exclude=/dev/* –exclude=/mnt/*
 –exclude=/boot/* –exclude=/root/* [email protected]:/* /

And then I get this error:

Unexpected remote arg: [email protected]:/*
rsync error: syntax or usage error (code 1) at main.c(1201) [sender=3.0.6]
1

2 Answers 2

9

I just got a similar error, and the following things might fix your problem:

  • Ensure --exclude has two hyphens preceding it
  • Place quotes around your excluded paths like --exclude '/boot/*'

The error is confusing, because it's not actually about the destination parameter, but often the parameters coming before it having incorrect syntax.

2
  • it was the previous parameter for me too
    – NickSoft
    Feb 21, 2020 at 19:13
  • same here - it didn't like --progress where I put it
    – superuser
    May 2, 2023 at 12:32
3

Here's a tip: Put the word echo in front of the command. You'll then see how the full expanded command line looks to the program.

In this case you would see the parameters with * expanded to contain multiple paths - not what you wanted or thought you had typed in - which at least points you in the right direction to fix the issue.

You must log in to answer this question.

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