A howto for rsync in weewx.

869 views
Skip to first unread message

Liz Dodd

unread,
Feb 19, 2022, 5:57:01 PM2/19/22
to weewx-user

I recently setup rsync with weewx. This took a couple of hours, and help from my friends, so I wrote out all the steps I used to make it work.
This is not the only way to make rsync work, but a single set of instructions.
Liz

rsync_weewx.txt

scratchypants

unread,
Dec 21, 2022, 9:34:32 PM12/21/22
to weewx-user
Thanks for this. One tidbit - my hosting service does not listen on the standard port, 22. This gave me fits, but I logged a support call and got the port number. Edited /etc/ssh/ssh_config, removed the '#' from the 'Port 22' line and changed the number to match.

Rory Gillies

unread,
Nov 23, 2023, 7:25:34 AM11/23/23
to weewx-user
Thanks for this, I can't FTP at the moment so turning to rsync. I have everything set up (instead of using www-data I am using the same user I use for FTP which has full access to /var/www/html/. I have set up the keys and can do a passwordless login from root on the local machine to the web user on the remote machine. When I run the command:

sudo rsync -arP /var/www/html/weewx/ user@my-remote-server:/var/www/html/weather

The files are correctly uploaded, however when Weewx preforms rsync I get:

Nov 23 12:22:15 weather weewx[1650762] ERROR weeutil.rsyncupload: rsync reported errors. Original command: ['rsync', '--archive', '--stats', '-e', 'ssh', '/var/www/html/weewx/', 'user@my-remote-server:/var/www/html/weather']
Nov 23 12:22:15 weather weewx[1650762] ERROR weeutil.rsyncupload: **** kex_exchange_identification: Connection closed by remote host
Nov 23 12:22:15 weather weewx[1650762] ERROR weeutil.rsyncupload: **** Connection closed by my-remote-server port 22
Nov 23 12:22:15 weather weewx[1650762] ERROR weeutil.rsyncupload: **** rsync: connection unexpectedly closed (0 bytes received so far) [sender]
Nov 23 12:22:15 weather weewx[1650762] ERROR weeutil.rsyncupload: **** rsync error: unexplained error (code 255) at io.c(228) [sender=3.2.3]

Any ideas? The fact it works from the shell points to something going on with Weewx that I'm not seeing.

Thanks,

Rory

Tomás

unread,
Nov 23, 2023, 7:43:19 AM11/23/23
to weewx-user
Hello! Maybe because weewx is being run as root? It seems you have the keys installed on your user, but probably not as root. If you manage weewx with systemd there is an option to run it as your user, hope it helps.
Tomás.-

Rory Gillies

unread,
Nov 23, 2023, 12:07:28 PM11/23/23
to weewx...@googlegroups.com
Hi Tomás,

Many thanks for your reply, it turns out the config was all correct but there was a typo in the remote server IP address in weewx.conf! A very cryptic error for the wrong server address.

All working now.

Rory

-- 
You received this message because you are subscribed to a topic in the Google Groups "weewx-user" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/weewx-user/_f3vkF26o_g/unsubscribe.
To unsubscribe from this group and all its topics, send an email to weewx-user+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/2cc28264-32ce-475b-8899-cfa81666fe68n%40googlegroups.com.

Reply all
Reply to author
Forward
0 new messages