RSYNC

92 views
Skip to first unread message

Jose

unread,
Jun 10, 2020, 6:21:43 AM6/10/20
to weewx-user
Hi


I want to send copy from raspberrypi to a remote server with rsync to update my website with last changes.
I have verified that I can connect via ssh passwordless using public and private keys with no problem to server (ssh user@server)
The problem comes when I try to do the same with rsync; an error message says that the remote host cannot be authenticated and connection fails.
I have modified the / etc / ssh / ssh_config file adding the Host, User and Identityfile (path to .ssh keys) but nothing changes.

What can I do?
Message has been deleted

gjr80

unread,
Jun 10, 2020, 8:00:13 AM6/10/20
to weewx-user
Hi,

By default the WeeWX daemon runs as root, so unless you have changed this root needs passwordless ssh access to the server to which you wish to sync your files. Did you give root passwordless ssh access or was it some other account? If this is the problem you have two choices; either change WeeWX to run as the user you have given passwordless ssh access or keep WeeWX running as root and give root passwordless ssh access.

The wiki article ‘Run WeeWX as a non-root user’ (https://github.com/weewx/weewx/wiki/Run-as-a-non-root-user) provides instructions on how to run WeeWX as a user other than root.

Gary

Jose

unread,
Jun 10, 2020, 5:17:02 PM6/10/20
to weewx-user
Hi, 

remote hosting is updated with new files using RSYNC from WeeWX, thank you, but if I am having some problems when I try to do it with 

 rsync -a --delete -e ssh /home/pi/backup.tar.gz  user@ssh.hosting:/www/backup/ &> /dev/null

this command worked fine in the past but not now. When I run this command nothing happens, no updating remote hosting and even no error messages. so RSYNC with WeeWX is working fine but RSYNC in command line don't. 

gjr80

unread,
Jun 10, 2020, 5:32:27 PM6/10/20
to weewx-user
My apologies, I thought your problem involved WeeWX rsync not working.

I assume you are trying to execute the command below from the command line on your WeeWX machine. As I pointed out in my previous post a common issue is that passwordless ssh has been setup for a given user account that is different to the user account that is later used to execute the rsync command. Are you sure the correct user account (still) has passwordless ssh access? If you are convinced this is correct my only other suggest is to look at the logs on the target server to see if you can find any error/reason for rejection.

Gary

Greg from Oz

unread,
Jun 10, 2020, 9:13:34 PM6/10/20
to weewx-user
This works for me....
rsync -ruva --delete -e "ssh -l root -i /root/.ssh/id_rsa" ro...@192.168.2.2:/backups/ $FILELOCATION/dmz/


On Thursday, 11 June 2020 07:17:02 UTC+10, Jose wrote:

Glenn McKechnie

unread,
Jun 10, 2020, 9:37:43 PM6/10/20
to weewx...@googlegroups.com
On 11/06/2020, Jose <solar...@gmail.com> wrote:
[...]
>
> rsync -a --delete -e ssh /home/pi/backup.tar.gz us...@ssh.hosting:/www/
> backup/ &> /dev/null
>
> this command worked fine in the past but not now. When I run this command
> nothing happens, no updating remote hosting and even no error messages. so
> RSYNC with WeeWX is working fine but RSYNC in command line don't.

Just focusing on your statement that you see no errors with the above command.
It's doing exactly what you've told it to, that you want no feedback
from it, ever. It's dead to you.
Send whatever it has to say (&>) to the bit bucket (/dev/null)

Remove that redirect that you have on the end and it will probably
offer up a few clues.

rsync -a --delete -e ssh /home/pi/backup.tar.gz us...@ssh.hosting:/www/ backup/

--


Cheers
Glenn

rorpi - read only raspberry pi & various weewx addons
https://github.com/glennmckechnie

Jose

unread,
Jun 11, 2020, 6:32:19 AM6/11/20
to weewx-user
hi Glenn
you are right. rsync -a --delete -e ssh /home/pi/backup.tar.gz  us...@ssh.hosting:/www/ backup/  it is working fine now. thanks. 
Reply all
Reply to author
Forward
0 new messages