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