RSYNC is using IP address and not host name

43 views
Skip to first unread message

Dan Jones

unread,
Aug 9, 2022, 11:14:32 AMAug 9
to weewx-user
My weewx.conf contains this:

[[RSYNC]]
    skin = Rsync
    HTML_ROOT = /var/www/html
    server = awsbox
    user = www-data
    path = /var/www/html
    delete = 0
    ssh_options = -i /root/.ssh/aws
    [[SSH]]
       ssh_options = -i /root/.ssh/aws


I have awsbox in my host file, pointing to the correct ip address

in my .ssh/config I have:

Host awsbox
    user www-data
    IdentityFile /root/.ssh/aws


when I start the Weewx server, I get this error 

DEBUG weeutil.rsyncupload: rsyncupload: cmd: [['rsync', '--archive', '--stats', '-e', 'ssh', '/tmp/weather34/serverdata/', 'www-...@123.123.123.123:/var/www/html/weather34/serverdata']]

(IP changed for security)

I can't see where the ip address is coming from. Is weewx or rsync converting it from the host file?

Also, It seems to be ignoring the ssh_options parameter (though I could be using the wrong) But I hope that it isn't required, as I guess that rsync should be using the config in .ssh/config

Any help would be greatly appreciated

This is all on the latest version of Weewx

John Kline

unread,
Aug 9, 2022, 11:52:18 AMAug 9
to weewx...@googlegroups.com
-i should refer to a file that contains a private key.  Is that the case?

On Aug 9, 2022, at 8:14 AM, Dan Jones <dan.rh...@gmail.com> wrote:

My weewx.conf contains this:
--
You received this message because you are subscribed to the Google Groups "weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-user+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/e84797ff-e452-4099-bac1-e032a1f6d903n%40googlegroups.com.

Dan Jones

unread,
Aug 9, 2022, 11:53:57 AMAug 9
to weewx-user
Yep, correct, its the private key. 

But it looks like that whole ssh_options bit is being ignored. I can't see it in the logs when I tail them. 

John Kline

unread,
Aug 9, 2022, 11:55:54 AMAug 9
to weewx...@googlegroups.com
Just to double check, it’s the private key and not the directory that contains the private key?

On Aug 9, 2022, at 8:54 AM, Dan Jones <dan.rh...@gmail.com> wrote:

Yep, correct, its the private key. 

Dan Jones

unread,
Aug 9, 2022, 11:59:39 AMAug 9
to weewx...@googlegroups.com
Yep it’s the actual private key and not the directory. 

On 9 Aug 2022, at 16:55, 'John Kline' via weewx-user <weewx...@googlegroups.com> wrote:


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/TGswy_m8yq0/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/DF74191E-EC21-495C-A048-DCB46C1A205C%40johnkline.com.

John Kline

unread,
Aug 9, 2022, 12:01:08 PMAug 9
to weewx...@googlegroups.com
Also, add:
debug = 1
In your weewx.conf file and restart WeeWX.

Your log will then contain output of the form:
rsyncupload: cmd: <actual-rsync-cmd>

That will tell you if -i is being passed (likely it is) and also let you try it from the command line.

On Aug 9, 2022, at 8:55 AM, John Kline <jo...@johnkline.com> wrote:



bell...@gmail.com

unread,
Aug 9, 2022, 12:01:46 PMAug 9
to weewx-user
I don’t have a [[SSH]] stanza. Try removing that.
rich

John Kline

unread,
Aug 9, 2022, 12:09:51 PMAug 9
to weewx...@googlegroups.com
Oh, I didn’t notice the SSH stanza, remove that line.  ssh_options should be directly under RSYNC.

On Aug 9, 2022, at 9:01 AM, bell...@gmail.com <bell...@gmail.com> wrote:

I don’t have a [[SSH]] stanza. Try removing that.

Dan Jones

unread,
Aug 9, 2022, 1:05:15 PMAug 9
to weewx-user
ssh stanza removed

debug on 1

output still the same:

DEBUG weeutil.rsyncupload: rsyncupload: cmd: [['rsync', '--archive', '--stats', '-e', 'ssh', '/tmp/weather34/serverdata/', 'www-...@123.123.123.123:/var/www/html/weather34/serverdata']]


Still ignoring ssh_options and still using IP address rather than host name.

Surely ssh_options wouldn't be needed if it used the host name, and then rsync would use .ssh/config with the correct host name configuration?

John Kline

unread,
Aug 9, 2022, 1:32:21 PMAug 9
to weewx...@googlegroups.com
Did you restart weewx after changing weewx.conf?

On Aug 9, 2022, at 10:05 AM, Dan Jones <dan.rh...@gmail.com> wrote:

ssh stanza removed

Dan Jones

unread,
Aug 9, 2022, 1:36:26 PMAug 9
to weewx...@googlegroups.com
Yep. I did 

On 9 Aug 2022, at 18:32, 'John Kline' via weewx-user <weewx...@googlegroups.com> wrote:


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/TGswy_m8yq0/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/AE34A74C-F383-4D53-9A98-DE0812E22BDD%40johnkline.com.

John Kline

unread,
Aug 9, 2022, 1:44:45 PMAug 9
to weewx...@googlegroups.com
I just examined the code in <weewx-home>/bin/weeutil/rsyncupload.py
It contains:
        if self.ssh_options:
            rsyncsshstring = rsyncsshstring + " " + self.ssh_options

I don’t see a how this couldn’t be including options.  Would you send your entire RSYNC stanza again?

On Aug 9, 2022, at 10:32 AM, John Kline <jo...@johnkline.com> wrote:



Dan Jones

unread,
Aug 9, 2022, 1:56:39 PMAug 9
to weewx-user
[[RSYNC]]
        skin = Rsync
        HTML_ROOT = /var/www/html
        server = awsbox
        user = www-data
        path = /var/www/html
        ssh_options = -i /root/.ssh/aws
        delete = 0

vince

unread,
Aug 9, 2022, 2:41:48 PMAug 9
to weewx-user
Not understanding why you're doing it that way.

Just add the identity file to the stanza in your /root/.ssh/config

Host awsbox 1.2.3.4
 IdentityFile ~/.ssh/id_rsa_my_remote_username
 user my_remote_username
 hostname 1.2.3.4

The stanza above lets you use either name or address.
FWIW, I use address on my aws lightsail stanza just in case my local DNS bounces (which is very rare)

Dan Jones

unread,
Aug 9, 2022, 2:53:18 PMAug 9
to weewx...@googlegroups.com
Well the things you learn!

Thanks, that worked. 

I didnt realise you could have ip address and hostname in the config like that, but it has done the trick

--
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/TGswy_m8yq0/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/9d13bb14-2a04-451f-b46e-ee18759faa24n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages