Rsync syntax or usage error

Rsync error syntax or usage error code 1 at main c

Содержание

  1. Rsync error syntax or usage error code 1 at main c
  2. Thread: rsync : unexpected remote arg
  3. rsync : unexpected remote arg
  4. Re: rsync : unexpected remote arg
  5. rsync (cwrsync) in Gitbash — The source and destination cannot both be remote. [windows 7]
  6. 3 Answers 3
  7. Linked
  8. Related
  9. Hot Network Questions
  10. Subscribe to RSS
  11. rsync succeeds from the shell but complains of «syntax or usage error» from crontab
  12. 1 Answer 1
  13. Rsync error syntax or usage error code 1 at main c
  14. Leave a Reply Cancel reply
  15. About Low End Box
  16. Recent Posts
  17. Popular Posts on LowEndTalk
  18. #1 NEW YEAR DEALS — SHARED HOSTING, KVM VPS HOSTING & RESELLER HOSTING + REAL PHYSICAL GIVEAWAYS
  19. Looking for US West Coast Anti-DDoS VPS
  20. TERRAHOST | Deployed our 10,000th server this week 😮 Custom KVM VPS inside!
  21. SEA – 8 GB RAM, BGP & Unmetered gigE @ $6/mo. Up to 30% off! DOUBLE RAM!! FREE GIVEAWAY!!
  22. Virtual Private Server Hosting FAQ

Rsync error syntax or usage error code 1 at main c

Профиль | Отправить PM | Цитировать

Есть шлюз на centos (а точнее clearos) он бэкапит свои настройки в локальную папку, задача перемещать этот архив на удаленную хранилку синолоджи (что за линукс на ней, я не знаю, но версия DSM 6.0-7321). На шлюзе я открыл порт как ssh так и для rsync, причем на обоих шлюзах, я к тому, что хранилка в другой сети за шлюзом. Брандмауэр на хранилке выключен, служба rsync поднята, есть даже из под системы возможность её теста — работает нормально, доступ есть. Сети объединены в локальную сеть с помощью ipsec

Синтаксис такой rsync -v /var/clearos/configuration_backup/backup-имяшлюза_домен_ru-03-25-2016-00-50-01.tgz пользователь@192.168.*.*:/GateBackUP — соответственно у данного пользователя есть права на эту папку, но вот на клиросе я ввожу саму команду под другим пользователем (под локальным рутом).

У меня выходят следующие ошибки:
ERROR: module is read only
rsync error: syntax or usage error (code 1) at main.c(1131) [Receiver=3.0.9]
rsync: connection unexpectedly closed (112 bytes received so far) [sender]
rsync error: error in rsync protocol data stream (code 12) at io.c(226) [sender=3.1.1]

Подскажите, как делаете вы? Или что в моём случае не правильно? Мне нужно потом это задать в cron, чтобы бэкап делался без моего ведома.

——-
В мире так много интересного.

Источник

Thread: rsync : unexpected remote arg

Thread Tools
Display

rsync : unexpected remote arg

I’m having a problem with rsync.I’m using public/private keys for authentication.

situation:
— command is run from (server2) where backups are stored
— both the backupserver & the webserver are configured in the firewall to allow ssh communication on port 2222
— sshd_config: AllowGroups rsyncer — AllowUsers rsyncer
— rsyncer uses /bin/bash shell
— rsyncer has on server1: read rights on /usr/share/joomla15/public_html folder, on server2: write rights on /home/rsyncer/backups/joomla
— authorized_keys on server1 contains from=»server2ip»

command executed on server2:
rsync -avvvz -e —progress «ssh -p 2222 -i /home/rsyncer/rsyncer.prv» rsyncer@server1:/usr/share/joomla15/public_html/xmlrpc /home/rsyncer/backups/joomla

700 /home/rsyncer — owner: rsyncer:rsyncer
700 /home/rsyncer/.ssh — owner: rsyncer:rsyncer
600 /home/rsyncer/.ssh/authorized_keys — owner: rsyncer:rsyncer

gives the following error:
unexpected remote arg: rsyncer@server1:/usr/share/joomla15/public_html/xmlrpc
rsync error: syntax or usage error (code 1) at main.c(1222) [sender=3.0.7]

Could someone tell me what also to lookout for ?

Re: rsync : unexpected remote arg

just found the solution browsing the net. You have to specify the user in the ssh statement. This works:
rsync -avvvz -e «ssh -p 2222 -i /home/rsyncer/rsyncer.prv -l rsyncer» rsyncer@server1:/usr/share/joomla15/public_html/xmlrpc /home/rsyncer/backups/joomla

Last edited by lowrider2025; May 4th, 2011 at 08:17 AM .

Источник

rsync (cwrsync) in Gitbash — The source and destination cannot both be remote. [windows 7]

I am trying to sync a local path to another drive using Git Bash in Windows 7. I downloaded cwRsync and copied the files over to my Git bash bin directory. I can run rsync but the following command gives me problems

rsync -av /c/00-dev/05-batch /f/RSYNC/ The source and destination cannot both be remote. rsync error: syntax or usage error (code 1) at main.c(1135) [receiver=3.0.6]

Both the paths are correct but it won’t sync.

3 Answers 3

Workaround: cd to /c and rsync using relative paths.

while this doesn’t, even if you cd to /c :

Tested with the Git Bash that came with git 2.9.0.windows.1 .

This works using cwRsync from Git Bash.

cwRsync.exe needs /cygdrive/ for absolute pathing, so the simple rsync -av /cygdrive/c/00-dev/05-batch /cygdrive/f/RSYNC/ works from the cmd.

However, Git Bash converts paths like . /c/. to weird things like . C:. . The line: export MSYS_NO_PATHCONV=1 prevents that conversion. (See more: How to stop MinGW and MSYS from mangling path names given at the command line).

Use unset MSYS_NO_PATHCONV in the script to restore standard Git Bash behavior.

In Windows I tried cwRsync to sync data between folders located on Z:(network disk) and D:(usb stick) excluding a subfolder ‘Data’:

-r means recursively, -v verbose output, —dry-run is just for testing (data doesn’t transfer), —exclude excludes subfolder or file(s), —chmod=ugo=rwX sets proper permissions (read more about permissions here with comments)

For cyrillic names on Windows use ‘chcp 65001’.

Linked

Hot Network Questions

To subscribe to this RSS feed, copy and paste this URL into your RSS reader.

Site design / logo © 2023 Stack Exchange Inc; user contributions licensed under CC BY-SA . rev 2023.1.14.43159

By clicking “Accept all cookies”, you agree Stack Exchange can store cookies on your device and disclose information in accordance with our Cookie Policy.

Источник

rsync succeeds from the shell but complains of «syntax or usage error» from crontab

The following crontab line (on CentOS 7.6)

fails, and sends me the following email message:

I looked at the source code of rsync’s main.c, but could not see the relevance of line 1567:

Furthermore, when I run that exact crontab line from the shell, it works:

Any ideas on how to debug this issue?

1 Answer 1

Broken cron jobs are frequently caused by testing the command in a different shell from the one cron uses. Most of the popular interactive shells like bash and zsh and the standard /bin/sh (used by cron) have similar basic syntax, because they’re all descended from the Bourne shell. The similarity between them is strong enough that you can get by, for a while, thinking that cron’s command syntax is the same as your login shell.

When you put more complex commands into a crontab, you find that there are differences. In your example, I suspect the command substitution operator . This type of substitution didn’t exist in Bourne shell, and I don’t think POSIX has adopted it either, so I wouldn’t trust it in a cron job.

Test your command in /bin/sh on your system by simply running one within your other shell:

If you can’t think of a way to rewrite the command in sh syntax, you can always explicitly invoke bash or any other shell you like:

This way involves an extra layer of quoting so that sh will pass the whole command to bash without trying to parse it. If that becomes too difficult, then put your command in a script with a nice #! line and run that from cron.

Источник

Rsync error syntax or usage error code 1 at main c

Be sure to exclude /etc/netplan/* + /etc/sysconfig/network-scripts/* + /etc/systemd/network/* as all these directories may contain various networking related files, which may destroy your target system.

hi,mr Jarland Donnell:
i encountered an error:
https://pastebin.com/g44EBE6j

how to solve it?

may be interesting to not rsync /etc/lvm
too

maybe you should exclude /lib/modues too
to be consistent with /boot exclusion

Because Numeric IDs are used, you need to replace /etc/passwd which didn’t happen for me, presumably because root didn’t have write access. It worked once I added write access (I also did shadow and sudoers)

Hi, I have do that from Linode to GCP Compute Engine Instance with the followwing command:

sudo rsync -auHxv –numeric-ids –exclude=/etc/fstab –exclude=/etc/network/* –exclude=/proc/* –exclude=/tmp/* –exclude=/sys/* –exclude=/dev/* –exclude=/mnt/* –exclude=/boot/* –exclude=/root/* root@172.104.50.88:/* /

Hello An, i have run the same command as u, AND rsync copying finishes successfully, but when i reboot my destination server, i cannot access the server via ssh, error”Could not connect to ‘34.92.95.3’ (port 22): Connection failed.” and i reinstall the os and start over to rsync and also try to update grub using command”grub2-mkconfig -o /boot/grub2/grub.cfg” but still got the same error, can you please tell me what did u do after entering the following command? thanks so much.

sudo rsync -auHxv –numeric-ids –exclude=/etc/fstab –exclude=/etc/network/* –exclude=/proc/* –exclude=/tmp/* –exclude=/sys/* –exclude=/dev/* –exclude=/mnt/* –exclude=/boot/* –exclude=/root/* root@IP ADDRESS:/* /

I’ve got the same problem that k k mentionned? When i’m doing rsync from one remote server to an other remote one, my server is not usable when it restarts, and my ssh is not working anymore.

You must exclude the folder with ssh keys

hi,
I ran into syntax errors while running this command in Debian 9. The command below worked for me.

rsync -auHxv –numeric-ids –-exclude ‘/etc/fstab’ -–exclude ‘/etc/network/*’ -–exclude ‘/proc/*’ -–exclude ‘/tmp/*’ -–exclude ‘/sys/*’ -–exclude ‘/dev/*’ -–exclude ‘/mnt/*’ –-exclude ‘/boot/*’ -–exclude ‘/root/*’ root@REMOTE_IP: /* /

I can’t delete the previous comment, but please ignore it, wrong command.
This one worked for me on Debian 9 after getting a lot of syntax errors from the recommended command here.

It’s not working for me, I need to copy all the data from centos 4 5 or 6 to a new centos server. I don’t care about wasting space I just need to copy the data minus the OS. I have tried the command but get errors.

Super Simple. I was going nuts with clonezilla. Just install OS (mine is ubuntu) copy over the root certificates and its done
This worked fine on Ubuntu 18.04
Tried to post the command but cloudflare blocked me LOL

Hi, Is it going to work on SUSE sap servers with licensing ? We need to migrate the server from old hypervisor to new.

Only this worked on Ubuntu 20 :
rsync -auHxv –numeric-ids –exclude=/etc/fstab –exclude=/etc/network/* –exclude=/proc/* –exclude=/tmp/* –exclude=/sys/* –exclude=/dev/* –exclude=/mnt/* –exclude=/boot/* –exclude=/root/* root@Server-IP:/* /

I use Ubuntu 20.04 and show error:
rsync error: syntax or usage error (code 1) at main.c(1372) [sender=3.1.3]

Leave a Reply Cancel reply

About Low End Box

LowEndBox is dedicated to helping people run websites and services on low end dedicated servers and cheap virtual private servers, where you only need to pay a few dollars a month. Our mission is to help people find cheap vps hosting. [Learn more about LowEndBox]

Recent Posts

  • Is the Portrait of J. Random Hacker Still Accurate? on 15 January 2023
  • Silicom Network: Cheap cPanel Shared Hosting Starting at Only $4.50/YEAR! on 15 January 2023
  • LowEndLOLs: Low End Therapy on 14 January 2023
  • Celebrate National Sticker Day with FREE Stickers PLUS an Awesome $1 Pack! on 13 January 2023
  • Our Articles Are Written By Humans, Unlike ONE Site We Could Name. And We Do. on 12 January 2023

Popular Posts on LowEndTalk

#1 NEW YEAR DEALS — SHARED HOSTING, KVM VPS HOSTING & RESELLER HOSTING + REAL PHYSICAL GIVEAWAYS

dustinc / Dec 26, 2022

Looking for US West Coast Anti-DDoS VPS

TERRAHOST | Deployed our 10,000th server this week 😮 Custom KVM VPS inside!

terrahost / Jan 15, 2023

SEA – 8 GB RAM, BGP & Unmetered gigE @ $6/mo. Up to 30% off! DOUBLE RAM!! FREE GIVEAWAY!!

Virtual Private Server Hosting FAQ

What is a VPS?
«VPS» stands for virtual private server, and means a virtual software instance running within a physical computer server. A virtual private server works like a dedicated physical server but relies on a virtualized software engine referred to as a «hypervisor» to provide the interface between the physical server and the virtual instance (aka «vps»).

Why do I want a VPS?
By choosing a «VPS» you are using a sliver of a physical dedicated server, which means lower costs, because you are only utilizing a piece of the physical capacities of the underlying server. Additionally, VPS plans often provide easy migration from location to location and server to server along with being able to upgrade or downgrade your resources with only a few clicks (rather than having to change physical server components).

Where can I find a cheap VPS?
On LowEndBox of course! Our website is dedicated to posting the best deals on cheap Linux VPS, cheap Windows VPS and dedicated servers from hosting providers all around the world. Check our home page daily to make sure you don’t miss the best hosting offers and subscribe to our mailing list.

Where can I learn more?
LowEndBox has published an in-depth frequently asked questions article on virtual private servers, why you want a cheap VPS, and more. Also check out our community message board, LowEndTalk, where thousands of users are happy to answer questions.

Источник

Adblock
detector

  • Gary Vanpelt

List of standard rsync exit codes

This is a list of rsync exit codes (rsync status codes / rsync error codes / rsync exit values).  

rsync is a utility that allows you to synchronize files and directories between two locations. It can be used to transfer files between local systems or to transfer files between a local system and a remote system. Here is a list of standard rsync exit codes and their meanings:

  • 0: Success. The rsync command completed successfully without any errors.
  • 1: Syntax or usage error. There was a problem with the syntax of the rsync command or with the options specified.
  • 2: Protocol incompatibility. There was a problem with the protocol version or negotiation between the rsync client and server.
  • 3: Errors selecting input/output files, dirs. There was a problem with the source or destination file or directory specified in the rsync command.
  • 4: Requested action not supported: An attempt was made to use an unsupported action or option.
  • 5: Error starting client-server protocol. There was an error starting the client-server protocol.
  • 6: Daemon unable to append to log-file. The rsync daemon was unable to write to its log file.
  • 10: Error in socket I/O. There was an error with the socket input/output.
  • 11: Error in file I/O. There was an error reading or writing to a file.
  • 12: Error in rsync protocol data stream. There was an error in the rsync protocol data stream.
  • 13: Errors with program diagnostics. There was an error generating program diagnostics.
  • 14: Error in IPC code. There was an error in the inter-process communication (IPC) code.
  • 20: Received SIGUSR1 or SIGINT. The rsync process was interrupted by a signal.
  • 21: Some error returned by waitpid(). An error occurred while waiting for a child process to complete.
  • 22: Error allocating core memory buffers. There was an error allocating memory buffers.
  • 23: Partial transfer due to error. The rsync command completed with an error, but some files may have been transferred successfully.
  • 24: Partial transfer due to vanished source files. Some source files disappeared before they could be transferred.

I hope this information is helpful! Let me know if you have any other questions.

Exit code 127

If you’re seeing exit code 127 after running rsync (i.e. in a script), it can mean you don’t even have rsync binary installed on your system.

Exit code 255

If you’re seeing exit code 255 after running rsync, it can mean rsync just passed exit code from a command it used to connect — typically SSH.

This would be essentially the same failure as SSH connecting:

Exit code on Linux / UNIX

To check rsync exit code on Linux / UNIX (or in fact, any other command), run this one just after rsync command:

Exit code on Windows

  • to check rsync exit code on Windows, run this one just after rsync command:

  • NB: The IF ERRORLEVEL n test succeeds if the error level is n or more. So — to capture just exit code 1:

  • in PowerShell, you can also use:

Error code 11 on Windows

Error code 11 can be confusing when rsync is started as a service on a Windows platform. It can mean that the pid file for rsync already exists in the C:Program FilescwRsyncServer folder (or ony other directory where rsync is installed) — although no other info will be given in Windows Event Log. It will become more apparent only if rsync is started as a service from the command line.

Great! You’ve successfully signed up.

Welcome back! You’ve successfully signed in.

You’ve successfully subscribed to Lxadm.com.

Your link has expired.

Success! Check your email for magic link to sign-in.

Success! Your billing info has been updated.

Your billing was not updated.

when i try to use rsync with —progress or -P option (—progress —partial) i get an error saying:

Unknown --info item: "flist"
rsync error: syntax or usage error (code 1) at options.c(453) [client=3.1.2]

I’m using ubuntu 18.04, uninstalled and reinstalled rsync but problem still persists. Example command:

rsync -avzP /home/test/testdir /home/test/testdir2/

or

rsync -avz --partial --progress /home/test/testdir /home/test/testdir2/

Rui F Ribeiro's user avatar

Rui F Ribeiro

54.8k26 gold badges144 silver badges221 bronze badges

asked Feb 1, 2019 at 12:54

Mustafa Yılmaz's user avatar

7

I just had the same problem, but it was resolved by adding LC_ALL=C before of the rsync command on the command line.

This confirms O.Yavuz’ thesis about localization (my computer also has Turkish system language).

Kusalananda's user avatar

Kusalananda

307k35 gold badges598 silver badges896 bronze badges

answered Nov 24, 2019 at 11:43

Emilio's user avatar

It’s most probably because of your localization settings. Set Ubuntu’s language to English, and country to US (maybe not necessary) and —progress option miraculously will start working.

Edit: «most probably» because I had same problem on my Raspberry Pi running Raspbian which is also Debian based as Ubuntu. I fixed the problem by changing system language from Turkish to English and country to US. But I don’t have Ubuntu to try so I had to make an assumption here.

Rui F Ribeiro's user avatar

Rui F Ribeiro

54.8k26 gold badges144 silver badges221 bronze badges

answered Mar 7, 2019 at 23:18

O.Yavuz's user avatar

1

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/* root@1.2.3.4:/* /

And then I get this error:

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

Sathyajith Bhat's user avatar

asked May 30, 2016 at 11:50

KeyJey's user avatar

1

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.

answered Jul 29, 2016 at 8:34

Simon E.'s user avatar

Simon E.Simon E.

3,6875 gold badges29 silver badges30 bronze badges

1

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.

answered Feb 4, 2017 at 23:44

Malvineous's user avatar

MalvineousMalvineous

2,3812 gold badges23 silver badges34 bronze badges

Понравилась статья? Поделить с друзьями:
  • Rsync sender write error broken pipe 32
  • Rsync error in rsync protocol data stream code 12 at io c
  • Rsync input output error 5
  • Rsync error chroot failed
  • Rsync error unexplained error code 255 at io c