FTP path difficulty

176 views
Skip to first unread message

David Rysdam

unread,
Jan 1, 2014, 9:55:44 AM1/1/14
to weewx...@googlegroups.com
With some difficulty, I've got my FTP set up, but it isn't
working. Because my FTP login isn't the same as the
~/public_html/... place I want to put the files, I have my path set like
this:

~/public_html/david/weather

However, the FTP then fails because

ftpupload: Failed to upload file ~/public_html/david/weather/NOAA/NOAA-2014.txt

Yes, I know. That file doesn't exist on *this* end. That's the destination.

Looking at the code, it looks like it wants to somehow combine HTML_ROOT
and "path" for some reason. How can I tell it I want to upload *from*
HTML_ROOT and *to* "path", when the two have no commonality? (I realize
the directory structure below those points will be identical--that's fine.)


mwall

unread,
Jan 1, 2014, 10:00:58 AM1/1/14
to weewx...@googlegroups.com, da...@rysdam.org


On Wednesday, January 1, 2014 9:55:44 AM UTC-5, David Rysdam wrote:
With some difficulty, I've got my FTP set up, but it isn't
working. Because my FTP login isn't the same as the
~/public_html/... place I want to put the files, I have my path set like
this:

    ~/public_html/david/weather

the tilde (~) is a shell shortcut for 'whatever your home directory is'.

use the full path instead of the shortcut.

m

Steve

unread,
Jan 1, 2014, 10:05:02 AM1/1/14
to weewx...@googlegroups.com, da...@rysdam.org
Here's what my working config looked like when I was running FTP:

[[FTP]]

 skin
= Ftp
 
# FTP'ing the results to a webserver is treated as just another report,
 
# albeit one with an unusual report generator!
 
#
 
# If you wish to use FTP, uncomment and fill out the next four lines:
 user
= user@myserver.com
 password
= myftppassword
 server
= myserver.com
 path
= /

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

 
# How many times to try to transfer a file before giving up:
 max_tries
= 3

 
# If you wish to upload files from something other than what HTML_ROOT
 
# is set to above, then reset it here:
 
# HTML_ROOT = public_html


So on my server side, I set the FTP account root as public_html/weather so as far as weewx was concerned it was FTPing to "/" a root.

weewx was just copying my locally created / generated files from its default location, so HTML_ROOT was commented out.

I hope this helps a bit.

David Rysdam

unread,
Jan 1, 2014, 10:35:25 AM1/1/14
to mwall, weewx...@googlegroups.com
Now I get these messages:

Failed to upload file /home6/<realusername>/public_html/david/weather/daywindvec.png

It's attempting to find that path on the LOCAL machine, but that's what
I want the REMOTE path to be.

mwall

unread,
Jan 1, 2014, 11:00:13 AM1/1/14
to weewx...@googlegroups.com, mwall, da...@rysdam.org
On Wednesday, January 1, 2014 10:35:25 AM UTC-5, David Rysdam wrote:
Now I get these messages:

    Failed to upload file /home6/<realusername>/public_html/david/weather/daywindvec.png

It's attempting to find that path on the LOCAL machine, but that's what
I want the REMOTE path to be.

the value for 'path' should be the absolute path to a directory on the remote system.

David Rysdam

unread,
Jan 1, 2014, 11:12:03 AM1/1/14
to mwall, weewx...@googlegroups.com, mwall
That's how I understood it and how I think I'm using it. However, I
still get these "failed to upload" messages like it's looking for that
path on the local system. I have the ftp debug bumped up to 2, here's
some of the output:

Jan 1 11:01:47 hero weewx[32617]: reportengine: Running report FTP
Jan 1 11:01:47 hero weewx[32617]: reportengine: Found configuration file /etc/weewx/skins/Ftp/skin.conf for report FTP
Jan 1 11:01:49 hero weewx[32617]: ftpupload: attempt #1. Failed uploading /home6/<realusername>/public_html/david/weather/daywind.png. Reason:
553 Can't open that file: No such file or directory
Jan 1 11:01:49 hero weewx[32617]: ftpupload: attempt #2. Failed uploading /home6/<realusername>/public_html/david/weather/daywind.png. Reason:
553 Can't open that file: No such file or directory
Jan 1 11:01:50 hero weewx[32617]: ftpupload: attempt #3. Failed uploading /home6/<realusername>/public_html/david/weather/daywind.png. Reason:
553 Can't open that file: No such file or directory

Here's the config:

user = <realusername>
password = <realpassword>
server = rysdam.org
path = /home6/<realusername>/public_html/david/weather

I haven't modified HTML_ROOT in the FTP section.

Steve

unread,
Jan 1, 2014, 11:18:07 AM1/1/14
to weewx...@googlegroups.com, mwall, da...@rysdam.org
When you use another client to log into the FTP server with the same credentials / username & password, where does it put you? At / of home6 

mwall

unread,
Jan 1, 2014, 11:18:33 AM1/1/14
to weewx...@googlegroups.com, mwall, da...@rysdam.org
On Wednesday, January 1, 2014 11:12:03 AM UTC-5, David Rysdam wrote:
    path = /home6/<realusername>/public_html/david/weather

does the directory

/home6/<realusername>/public_html/david/weather

exist on the remote system?

David Rysdam

unread,
Jan 1, 2014, 11:21:11 AM1/1/14
to Steve, weewx...@googlegroups.com, mwall
Steve <wot...@gmail.com> writes:
> When you use another client to log into the FTP server with the same
> credentials / username & password, where does it put you? At / of home6

oooooh, no. I see, it needs an "absolute" path relative to where the FTP
root is. OK, let me try:

/public_html/david/weather

mwall

unread,
Jan 1, 2014, 11:21:48 AM1/1/14
to weewx...@googlegroups.com, mwall, da...@rysdam.org
On Wednesday, January 1, 2014 11:18:07 AM UTC-5, Steve wrote:
When you use another client to log into the FTP server with the same credentials / username & password, where does it put you? At / of home6 

every ftp client should end up in the same place, but an ssh client could very well have a different / than the / for the ftp client.  that depends on how the remote system is configured.

for example, the directory /home6/foobar for the ssh client could be simply / for the ftp client.

m

Steve

unread,
Jan 1, 2014, 11:34:26 AM1/1/14
to weewx...@googlegroups.com, mwall, da...@rysdam.org
If I ftp as my "main" ftp account it takes me to / of my server

If I ftp as my "weewx" ftp account it takes me to myserver/public_html/weather

So for my weewx.conf using the weewx ftp account "/" is all it needs as it only has access to myserver/public_html/weather

Depending what account I FTP in with, the destination is a different directory on my server. Or perhaps we're saying the same thing?

David Rysdam

unread,
Jan 1, 2014, 11:54:39 AM1/1/14
to Steve, weewx...@googlegroups.com, mwall
Bingo, this worked!

Steve

unread,
Jan 1, 2014, 11:56:31 AM1/1/14
to weewx...@googlegroups.com, Steve, mwall, da...@rysdam.org
Yep, even I can see it :)
Reply all
Reply to author
Forward
0 new messages