Okay...... Thanks all for the thoughts and comments.

For the sake of anyone fighting this same issue somewhere in the future, 
let me get this refocused, clarified, up to date.

Baseline Info
------
1) Host Machine is a hosting company
2) The host machine is a shared Linux based machine
3) I own the domain and rent the hosting
4) In the absolute path... home3/fiaranch/........ - everything under and 
past 'fiaranch' I have full control of

5) Client Machine is mine and is a private machine to be used and abused as 
I see fit. :o)

Users Question - Closed
With regards to this issue with WeeWX, all activity will be with my root 
hat on.

SSH Keys Issue - Closed
Thanks to Vince I learned that user and root keys are independant.  Now 
both root and user have their own keys and they have been tested.

SSH Port Question - Closed
The hosting company states two ports as follows:
SSH - 22
SSH Shared/Reseller Servers - 2222
NOTE - Command line Rsync actually works with both


Question of "/" placement - Closed

Thank you cric...@pobox.com for the definition of differentiation.

File placement on the host is absolute path 
/home3/fiaranch/public_html/weather/*.*

Using command line, Rsync will accept both, which makes sense based on what 
cric...@pobox.com stated.

Command (WITH trailing '/') - root@weather:~# rsync -avhze ssh --progress 
--update --stats  /var/www/html/ --delete 
fiara...@fiaranch.com:/home3/fiaranch/public_html/weather/

Result (without all the superfulous data)
sent 595.67K bytes  received 17.85K bytes  31.46K bytes/sec
total size is 1.79M  speedup is 2.91

Command (WITHOUT trailing '/') - root@weather:~# rsync -avhze ssh 
--progress --update --stats  /var/www/html/ --delete 
fiara...@fiaranch.com:/home3/fiaranch/public_html/weather

Result (without all the superfulous data)
sent 309.53K bytes  received 12.20K bytes  71.49K bytes/sec
total size is 1.86M  speedup is 5.77

Note - The result difference is mainly a time difference.  However, based 
on differentiation cric...@pobox.com stated, I am going to go forward 
without the trailing '/'.

So that brings me to WeeWX config discussion.

The WeeWX Config is now as follows:
skin = Rsync
enable = true
server = fiaranch.com
user = fiaranch
path = /home3/fiaranch/public_html/weather
port = 2222
log_success = true
log_failure = true
HTML_ROOT = /var/www/html
delete = 1

Notes:
1) The two log entries I added from what Vince posted.  Just to see if that 
provides any additional information.
2) Removed the trailing '/' from the path.

Results
Nov 15 09:34:23 weather weewx[5274] DEBUG weewx.reportengine: Running 
report 'RSYNC'
Nov 15 09:34:23 weather weewx[5274] DEBUG weewx.reportengine: Found 
configuration file /etc/weewx/skins/Rsync/skin.conf for report 'RSYNC'
Nov 15 09:34:23 weather weewx[5274] DEBUG weewx.reportengine: Cannot read 
localization file /etc/weewx/skins/Rsync/lang/en.conf for report 'RSYNC': 
Config file not found: "/etc/weewx/skins/Rsync/lang/en.conf".
Nov 15 09:34:23 weather weewx[5274] DEBUG weewx.reportengine: **** Using 
defaults instead.
Nov 15 09:34:23 weather weewx[5274] DEBUG weeutil.rsyncupload: rsyncupload: 
cmd: [['rsync', '--archive', '--stats', '--delete', '-e', 'ssh -p 2222', 
'/var/www/html/', 
'fiara...@fiaranch.com:/home3/fiaranch/public_html/weather']]
Nov 15 09:34:26 weather weewx[5274] INFO weeutil.rsyncupload: rsync'd 56 
files (1,093,360 bytes) in 2.42 seconds

WHAT !!!!!

All said and done.... the failures can be attributed to two things:
1) SSH Keys must be paired under root, not user - Thank You Vince
2) No trailing '/' in the path.  Even though it will work in a command line 
Rsync, it will not work in WeeWX.

Discussion Closed!!!!

Thanks to all for the comments, ideas, assistance, and sharing your 
experience!

Now going to play with Rsync options to see if I can break it again!!  LMFAO







On Tuesday, November 15, 2022 at 9:17:55 AM UTC-7 jo...@johnkline.com wrote:

> A trailing slash means copy the contents of the directory.
>
> Note that WeeWX code will add the slash if it is a directory.  See code 
> snippet below.
>
> [image: weewx.png]
>
> weewx/rsyncupload.py at master · weewx/weewx 
> <https://github.com/weewx/weewx/blob/master/bin/weeutil/rsyncupload.py>
> github.com 
> <https://github.com/weewx/weewx/blob/master/bin/weeutil/rsyncupload.py>
> <https://github.com/weewx/weewx/blob/master/bin/weeutil/rsyncupload.py>
>
>         # If the source path ends with a slash, rsync interprets
>         # that as a request to copy all the directory's *contents*,
>         # whereas if it doesn't, it copies the entire directory.
>         # We want the former, so make it end with a slash.
>         # Note: Don't add the slash if local_root isn't a directory
>         if self.local_root.endswith(os.sep) or not 
> os.path.isdir(self.local_root):
>             rsynclocalspec = self.local_root
>         else:
>             rsynclocalspec = self.local_root + os.sep
>
>
> On Nov 15, 2022, at 7:33 AM, cric...@pobox.com <cric...@pobox.com> wrote:
>
> A couple of points about the trailing slashes.  A trailing slash means 
> copy the contents of the directory.  The --archive
>
> means copy everything below the specified directory.  Not including a 
> trailing slash means copy this directory and with
> --archive, everything below it.  It's not a matter of rsync not working 
> because of the slashes, it just does two similar, but
> different things.  The man pages for rsync are pretty good.
> As for the ssh keys, I'm pretty sure you can just copy the 
> ~fiaranch/.ssh/id_rsa to ~root/.ssh.  No need to create root-specific
> key pair and copy the public server's .ssh directory.  Oh, one other thing 
> that's really important:
>
> The .ssh directory permissions are critical.  The directory itself must be 
> chmod 0700.  The files inside it should be chmod 0600.
> This is true for all the .ssh directories on both ends of the connection.
>
> My setup is a little different; I rsync to another local machine that runs 
> a web server.  Then I've got a separate script for
> publishing the weewx (and a few other sites) to a public host, since the 
> various href's need to be updated.
>
> On Tuesday, November 15, 2022 at 5:25:11 AM UTC-7 Greg Troxel wrote:
>
>>
>> "gszla...@gmail.com" <gszla...@gmail.com> writes: 
>>
>> > 1. Vince is correct. WeeWX runs as root and RSA generation must be done 
>> as 
>> > root. 
>>
>> I was sure Vince was correct to start with :-) but I think running weewx 
>> as root is the wrong thing to do. I run it as a non-root user, and 
>> really there should be a dedicated weewx user that has permissions to do 
>> what it needs (read the serial port, write the db, access credentials 
>> for upload) and no more. 
>>
>> But this is really "how best to configure weewx on operating system X", 
>> which is orthogonal to "how should I made weewx on system X already 
>> configured as Y work". 
>>
> -- 
> 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/a69561f5-048a-4e2f-bc8f-e009a9cc2911n%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/weewx-user/a69561f5-048a-4e2f-bc8f-e009a9cc2911n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/0f2ee07f-8636-4e0b-93a1-25888312dc87n%40googlegroups.com.

Reply via email to