remote directory

173 views
Skip to first unread message

mentero

unread,
Aug 1, 2019, 5:09:02 AM8/1/19
to weewx-user
Hi,

I am changing the server running weewx due to a disaster with the old one, with a fresh (Debian) installation of the latest release. Also upgrading exfoliation skin.
 
I would like the files to be ftp'd to the remote /www directory as specified in weewx.conf (path = /www), instead of /www/exfoliation.

Any tip will be appreciated.

Miguel

mentero

unread,
Aug 2, 2019, 3:48:14 AM8/2/19
to weewx-user
Hi,
Found a workaround with a .htaccess file placed in the server root directory with the instruction:
___________________________________
Redirect index.html /exfoliation/index.html
___________________________________

Anyway if somebody knows how to ftp exfoliation files directly to the server root (/www/files.ext) instead of an exfoliation subdirectory, (/www/exfoliation/files.ext) and avoid redirections i'll be glad to know how.

Thanks in advance
Miguel



gjr80

unread,
Aug 3, 2019, 6:44:56 AM8/3/19
to weewx-user
Hi,

I know you said ftp but are you ftp’ing to another server or are the files generated and saved/copied on the same server as WeeWX? If the former it should be a simple case of altering some config settings under the [StdReport] [[FTP]] stanza in weewx.conf, if the latter then some skin overrides in [StdReport] should be all that is required.

Probably the easiest approach is for you to post a sanitised copy (obfuscate any user names, passwords etc) of the [StdReport] stanza from weewx.conf.

Gary

mentero

unread,
Aug 3, 2019, 7:08:55 AM8/3/19
to weewx-user
Hi Gary, thanks for your answer.

I am ftp'ing to a different server, not the machine running weewx.

Find attached the requested code. Any report (I have tried Seasons and Smartphone) will ftp to "/www" (public_html in my host), but exfoliation is ftp'ing to "/www/exfoliation".

Weex is 3.9.2 installed using apt-get and exfoliation is 0.45 installed as per github instructions.

Miguel

(From /etc/weewx/weewx.conf)
-------------------------------------------------------------
   [[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 passwords to guard against parsing errors.

        enable = true
        user = YYYYYYY
        password = XXXXXXXX
        server = ftp.meteolea.com    # The ftp server name, e.g, www.myserver.org
        path = /www    # 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 = /var/www/html/weewx

        # Most FTP servers use port 21
        port = 21

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

--------------------------------------------------------


Message has been deleted

gjr80

unread,
Aug 3, 2019, 7:23:14 AM8/3/19
to weewx-user
OK, so under [[FTP]] uncomment the HTML_ROOT setting and set it to the directory that contains the generated exfoliation files. Save weewx.conf and restart Weewx.

Gary

mentero

unread,
Aug 3, 2019, 7:41:31 AM8/3/19
to weewx-user
Line uncommented,
weewx.conf saved,
sudo /etc/init.d/weewx stop
sudo /etc/init.d/weewx start
sudo /usr/share/weewx/wee_reports

But still no luck.
Miguel

Aug  3 13:38:45 oleaserver wee_reports[4007]: reportengine: Running reports for latest time in the database.
Aug  3 13:38:45 oleaserver wee_reports[4007]: reportengine: Report 'SeasonsReport' not enabled. Skipping.
Aug  3 13:38:45 oleaserver wee_reports[4007]: reportengine: Running report 'exfoliation'
Aug  3 13:38:45 oleaserver wee_reports[4007]: reportengine: Found configuration file /etc/weewx/skins/exfoliation/skin.conf for report 'exfoliation'
Aug  3 13:38:47 oleaserver wee_reports[4007]: cheetahgenerator: using search list ['weewx.cheetahgenerator.Almanac', 'weewx.cheetahgenerator.Station', 'weewx.cheetahgenerator.Current', 'weewx.cheetahgenerator.Stats', 'weewx.cheetahgenerator.UnitInfo', 'weewx.cheetahgenerator.Extras']
Aug  3 13:38:47 oleaserver wee_reports[4007]: manager: Daily summary version is 2.0
Aug  3 13:38:55 oleaserver wee_reports[4007]: cheetahgenerator: Skip 'forecast.html': last_mod=1564830035.7 age=2299.37405086 stale=3570
Aug  3 13:39:13 oleaserver wee_reports[4007]: cheetahgenerator: Generated 8 files for report exfoliation in 26.79 seconds
Aug  3 13:39:14 oleaserver wee_reports[4007]: manager: Daily summary version is 2.0
Aug  3 13:39:20 oleaserver wee_reports[4007]: imagegenerator: Generated 17 images for exfoliation in 6.60 seconds
Aug  3 13:39:20 oleaserver wee_reports[4007]: copygenerator: copied 92 files to /var/www/html/weewx/exfoliation
Aug  3 13:39:20 oleaserver wee_reports[4007]: reportengine: Running report 'FTP'
Aug  3 13:39:20 oleaserver wee_reports[4007]: reportengine: Found configuration file /etc/weewx/skins/Ftp/skin.conf for report 'FTP'
Aug  3 13:39:21 oleaserver wee_reports[4007]: ftpupload: Attempting connection to ftp.meteolea.com
Aug  3 13:39:21 oleaserver wee_reports[4007]: ftpupload: Connected to ftp.meteolea.com
Aug  3 13:39:22 oleaserver wee_reports[4007]: ftpupload: Uploaded file /www/exfoliation/almanac.html
Aug  3 13:39:22 oleaserver wee_reports[4007]: ftpupload: Uploaded file /www/exfoliation/dayinhum.png
Aug  3 13:39:22 oleaserver wee_reports[4007]: ftpupload: Uploaded file /www/exfoliation/station.html
Aug  3 13:39:23 oleaserver wee_reports[4007]: ftpupload: Uploaded file /www/exfoliation/daywinddir.png
Aug  3 13:39:24 oleaserver wee_reports[4007]: ftpupload: Uploaded file /www/exfoliation/daybarometer.png
Aug  3 13:39:24 oleaserver wee_reports[4007]: ftpupload: Uploaded file /www/exfoliation/index.html







gjr80

unread,
Aug 3, 2019, 8:01:12 AM8/3/19
to weewx-user
What did you set HTML_ROOT to? /var/www/html/weewx/exfoliation?

Gary

mentero

unread,
Aug 3, 2019, 8:14:21 AM8/3/19
to weewx-user
Now I am a confused, it seems that there is more than one definition of HTML_ROOT (?)

Miguel


[StdReport]

    # Where the skins reside, relative to WEEWX_ROOT
    SKIN_ROOT = /etc/weewx/skins

    # Where the generated reports should go, relative to WEEWX_ROOT
    HTML_ROOT = /var/www/html/weewx

    # The database binding indicates which data should be used in reports.
    data_binding = wx_binding

    # Whether to log a successful operation
    log_success = True

    # Whether to log an unsuccessful operation
    log_failure = False

    # Each of the following subsections defines a report that will be run.
    # See the customizing guide to change the units, plot types and line
    # colors, modify the fonts, display additional sensor data, and other
    # customizations. Many of those changes can be made here by overriding
    # parameters, or by modifying templates within the skin itself.

    [[SeasonsReport]]
        # The SeasonsReport uses the 'Seasons' skin, which contains the
        # images, templates and plots for the report.
        skin = Seasons
        enable = false

    #    [[SmartphoneReport]]
    #        # The SmartphoneReport uses the 'Smartphone' skin, and the images and
    #        # files are placed in a dedicated subdirectory.
    #        skin = Smartphone
    #        enable = false
    #        HTML_ROOT = /var/www/html/weewx/smartphone

    #    [[MobileReport]]
    #        # The MobileReport uses the 'Mobile' skin, and the images and files
    #        # are placed in a dedicated subdirectory.
    #        skin = Mobile
    #        enable = false
    #        HTML_ROOT = /var/www/html/weewx/mobile

    #    [[StandardReport]]
    #        # This is the old "Standard" skin. By default, it is not enabled.
    #        skin = Standard
    #        enable = false

    [[exfoliation]]
        HTML_ROOT = /var/www/html/weewx/exfoliation
        skin = exfoliation
        #        enable = true
        [[[Extras]]]
            current_show_radar = true

    #old    [[Exfoliation]]
    #old        SKIN_ROOT = skins
    #old        skin = exfoliation
    #old        HTML_ROOT = public_html
    #old        [[[Extras]]]
    #old            footer = /home/weewx/skins/exfoliation/footer.inc
    #old            header = /home/weewx/skins/exfoliation/header.inc
    #old            hilo = /home/weewx/skins/exfoliation/hilo.inc

    [[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 passwords to guard against parsing errors.

        enable = true
        user = XXXXXX
        password = YYYYYYYY

        server = ftp.meteolea.com    # The ftp server name, e.g, www.myserver.org
        path = /www/    # 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 = /var/www/html/weewx


        # Most FTP servers use port 21
        port = 21

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

    [[RSYNC]]




mentero

unread,
Aug 3, 2019, 9:19:50 AM8/3/19
to weewx-user

Gary, you make my day. I changed the line HTML_ROOT = /var/www/html/weewx/exfoliation under [[exfoliation]] to HTML_ROOT = /var/www/html/weewx/ and everything is working.

Than you, if you ever come near to the coordinates at www.meteolea.com, beers will be ready.

I have changed many things in the last days, and I can't be sure, but I woud say that this line has been generated by the exfoliation installer. A note on the github documentation will be welcome for the users that do not know very well what they are doing. (my case).

Miguel






gjr80

unread,
Aug 3, 2019, 9:48:16 AM8/3/19
to weewx-user
Apologies, was out. Good that you have it sorted Miguel. Just to go back to your previous post, there is only one HTML_ROOT but it can be set in many places, the location of the setting in the config hierarchy determines where that particular value is applied. You might like to read the section on ‘Option hierarchy’ in the User’s Guide (weewx.com/docs/usersguide.htm#Option_hierarchy). It is important to grasp the option hierarchy used by WeeWX if you intend tinkering as otherwise it is all too easy find your self fighting for control of options (and usually losing).

HTML_ROOT is usually used when dealing with WeeWX generated output (mainly reports) so you will typically find it used throughout the [StdReport] stanza in weewx.conf and throughput skin.conf.

If you have been trying a lot of different combinations and have a fairly ‘well used’ weewx.conf or skin.conf it can be worthwhile tidying it up a bit to remove the possibility of confusion later. Just make sure you take a copy of your working config before digging in lest you break something during your clean up.

Gary

mentero

unread,
Aug 4, 2019, 4:48:31 AM8/4/19
to weewx-user
Thanks again,

followed your advise, did my doc reading and my .conf cleaning, and everything is working. Time for some job on page formatting....

What worked for me, in case somebody finds a similar issue.

From /etc/weewx/weewx.conf
............................
        # Where the generated reports should go, relative to WEEWX_ROOT
            HTML_ROOT = /var/www/html/weewx/exfoliation
............................
        [[exfoliation]]
            HTML_ROOT = /var/www/html/weewx/exfoliation
            skin = exfoliation
               [[[Extras]]]
                  current_show_radar = true
.........................
          # To upload files from something other than what HTML_ROOT is set
          # to above, specify a different HTML_ROOT here.
            HTML_ROOT = /var/www/html/weewx/exfoliation
............................

Miguel



Reply all
Reply to author
Forward
0 new messages