Setting up RSYNC

72 views
Skip to first unread message

bgra...@umw.edu

unread,
May 15, 2026, 11:32:04 AM (7 days ago) May 15
to weewx-user
After finally getting my FTP working (many thanks to all!) I am trying to move to RSYNC but having problems.

Following Vince's guide, I have created keys and moved them to my web server grattans.org.
Testing, I can ssh to grattans.org with no password. However, running RSYNC in weewx.conf is coming up with errors.

 ERROR weeutil.rsyncupload: rsync reported errors. Original command: ['rsync', '--archive', '--stats', '-e', 'ssh', '/home/pi/weewx-data/public_html/', 'mk0a7k...@grattans.org:/public_html/WeeWX']
May 15 10:45:25 rpi5trixie weewxd[659616]: ERROR weeutil.rsyncupload: **** tput: No value for $TERM and no -T specified
May 15 10:45:25 rpi5trixie weewxd[659616]: ERROR weeutil.rsyncupload: **** rsync: mkdir "/public_html/WeeWX" failed: No such file or directory (2)
May 15 10:45:25 rpi5trixie weewxd[659616]: ERROR weeutil.rsyncupload: **** rsync error: error in file IO (code 11) at main.c(661) [Receiver=3.1.3]

My syslog also has many lines like the following:

failed: Read-only file system [v8.2504.0 try https://www.rsyslog.com/e/2207 ]
2026-05-12T22:00:16.785339-04:00 rpi5trixie rsyslogd: error during config processing: omfile: creating parent directories for file  '/home/pi/weewx-data/log/weewx.log' failed: Read-only file system [v8.2504.0 try https://www.rsyslog.com/e/2207 ]
2026-05-12T22:00:16.846607-04:00 rpi5trixie rsyslogd: error during config processing: omfile: creating parent directories for file  '/home/pi/weewx-data/log/weewx.log'

My RSYNC section of weewx.conf is based on my working FTP section:

 [[FTP]]
        # FTP'ing the results to a webserver is treated as just another report,
        # albeit one with an unusual report generator!
        skin = Ftp

        # If you wish to use FTP, set "enable" to "true", then fill out the
        # next four lines.
        # Use quotes around the password to guard against parsing errors.
        enable = false    ##false
        user = mk0a7kyn5q5j
        password = H0xxxx
        server = grattans.org    # The ftp server name, e.g, www.myserver.org
        path = /public_html/WeeWX    # The destination directory, e.g., /weather

        # Set to True for an FTP over TLS (FTPS) connection. Not all servers
        # support this.
        secure_ftp = False

        # To upload files from something other than what HTML_ROOT is set
        # to above, specify a different HTML_ROOT here.
        HTML_ROOT = public_html

        # Most FTP servers use port 21.
        port = 21

        # Set to 1 to use passive mode, zero for active mode
        passive = 1

    [[RSYNC]]
        # rsync'ing to a webserver is treated as just another report.
        skin = Rsync

        # If you wish to use rsync, you must configure passwordless ssh using
        # public/private key authentication from the user account that weewx
        # runs to the user account on the remote machine where the files
        # will be copied.
        #
        # If you wish to use rsync, set "enable" to "true", then
        # fill out server, user, and path.
        # The server should appear in your .ssh/config file.
        # The user is the username used in the identity file.
        # The path is the destination directory, such as /var/www/html/weather.
        # Be sure that the user has write permissions on the destination!
        enable = true
        server = grattans.org
        user = mk0a7kyn5q5j
        path = /public_html/WeeWX

        # To upload files from something other than what HTML_ROOT is set
        # to above, specify a different HTML_ROOT here.
        #HTML_ROOT = public_html
        log_success = true             # log successful uploads (default = false)
        log_failure = true             # log unsuccessful uploads (default = false)

        # Rsync can be configured to remove files from the remote server if
        # they don't exist under HTML_ROOT locally. USE WITH CAUTION: if you
        # make a mistake in the remote path, you could could unintentionally
        # cause unrelated files to be deleted. Set to 1 to enable remote file
        # deletion, zero to allow files to accumulate remotely.
        delete = 0

My ~/.ssh directory:

(weewx-venv) pi@rpi5trixie:~/weewx-data $ ll ~/.ssh
total 28
-rw-rw-r-- 1 pi pi   90 May 14 16:33 config
-rw------- 1 pi pi 2098 May 14 10:23 known_hosts
-rw------- 1 pi pi 1262 May 14 07:37 known_hosts.old
-rw------- 1 pi pi 2602 May 12 14:04 old_id_rsa
-rw-r--r-- 1 pi pi  567 May 12 14:04 old_id_rsa.pub
-rw------- 1 pi pi  399 May 14 10:12 weewx
-rw-r--r-- 1 pi pi   95 May 14 10:12 weewx.pub

My local /.ssh/config:  [does this need to be on the web host also?]

host grattans.org
  hostname grattans.org
  user mk0a7kyn5q5j
  identityfile ~/.ssh/weewx

Can anyone spot the problem. I have tried to follow Vince's directions but have messed up somewhere.  Thanks in advance.

Cheers,
Bob



jterr...@gmail.com

unread,
May 15, 2026, 12:26:34 PM (7 days ago) May 15
to weewx-user
On your host grattans.org, is "/public_html/WeeWX" the folder containing your web site ?
If not, you have to change the path to point to the rignt folder :
enable = true
        server = grattans.org
        user = mk0a7kyn5q5j
        path = ??????????

Vince Skahan

unread,
May 15, 2026, 1:25:55 PM (7 days ago) May 15
to weewx-user
No the .ssh/config file is client-side only.

Unfortunately the full pathname to use for rsync is something you'll have to figure out experimentally since every service provider tends to be different.  Some do a lot of sleight of hand with how they set things up so they can maintain their side.
  • Try ssh'ing into the server and run 'pwd' and see what it gives you for an absolute pathname.  Run 'ls' and see if your public_html tree is there hopefully.
  • Alternately ftp into the host using the user/pass you have working now and try 'pwd' there and see what it tells you.
If you have passwordless ssh working, you're much of the way there.....your weewx is logging in correctly, so all you need now is to figure out the remote full path to where you want to rsync into.

bgra...@umw.edu

unread,
May 15, 2026, 2:30:46 PM (6 days ago) May 15
to weewx-user
Here is the output from ssh and ftp. I have removed extra listings of files.

ssh
pi@rpi5trixie:~ $ ssh grattans.org
mk0a7kyn5q5j@p3plzcpnl505867 [~]$ pwd
/home/mk0a7kyn5q5j
mk0a7kyn5q5j@p3plzcpnl505867 [~]$ ll
drwxr-xr-x  6 mk0a7kyn5q5j nobody       4096 Nov 18  2024 public_html
mk0a7kyn5q5j@p3plzcpnl505867 [~]$ cd public_html
mk0a7kyn5q5j@p3plzcpnl505867 [~/public_html]$ pwd
/home/mk0a7kyn5q5j/public_html
mk0a7kyn5q5j@p3plzcpnl505867 [~/public_html]$ ll
drwxr-xr-x 13 mk0a7kyn5q5j mk0a7kyn5q5j  4096 Apr 17 12:30 WeeWX
-rw-r--r-- 1 mk0a7kyn5q5j mk0a7kyn5q5j  35311 May 15 11:00  index.html


ftp
Password:
230 OK. Current restricted directory is /
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> pwd
Remote directory: /
ftp> ls -l
drwxr-xr-x    6 mk0a7kyn5q 65534            4096 Nov 18  2024 public_html
ftp> cd public_html
250 OK. Current directory is /public_html
ftp> pwd
Remote directory: /public_html
ftp> ls -l
drwxr-xr-x   13 mk0a7kyn5q mk0a7kyn5q       4096 Apr 17 12:30 WeeWX
ftp> cd WeeWX
250 OK. Current directory is /public_html/WeeWX
ftp>
ftp> cd WeeWX
250 OK. Current directory is /public_html/WeeWX
ftp> ls -l
229 Extended Passive Mode Entered (|||50893|)
150 Accepted data connection
-rw-r--r--    1 mk0a7kyn5q mk0a7kyn5q      35311 May 15 11:00 index.html


Vince Skahan

unread,
May 15, 2026, 2:35:37 PM (6 days ago) May 15
to weewx-user
Assuming you see the previously uploaded web output from weewx under there, use the /home/mk0a7kyn5q5j/public_html  path that rsync told you.

The ftp path appears different because of how your service provider does things.  I won't get into the details there.

Remember to disable the FTP uploader if you turn the RSYNC uploader on and restart weewx to make it take effect.

Vince Skahan

unread,
May 15, 2026, 2:36:48 PM (6 days ago) May 15
to weewx-user
oops - looks like your previous stuff would be in /home/yourusername/public_html/WeeWX it appears.  Sorry 'bout that.

bgra...@umw.edu

unread,
May 15, 2026, 3:09:07 PM (6 days ago) May 15
to weewx-user
That did it! I modified the path.

 weewxd[708788]: INFO weeutil.rsyncupload: rsync'd 445 files (4,220,759 bytes) in 7.42 seconds

Many thanks (again!), Vince, et merci bien à jterr.

Cheers,
Bob
Reply all
Reply to author
Forward
0 new messages