Welcome to the Cumulus Support forum.

Latest Cumulus MX V3 release 3.28.6 (build 3283) - 21 March 2024

Cumulus MX V4 beta test release 4.0.0 (build 4018) - 28 March 2024

Legacy Cumulus 1 release v1.9.4 (build 1099) - 28 November 2014 (a patch is available for 1.9.4 build 1099 that extends the date range of drop-down menus to 2030)

Download the Software (Cumulus MX / Cumulus 1 and other related items) from the Wiki

scp instead of ftp

Topics about the Beta trials up to Build 3043, the last build by Cumulus's founder Steve Loft. It was by this time way out of Beta but Steve wanted to keep it that way until he made a decision on his and Cumulus's future.

Moderator: mcrossley

Locked
tumutbound
Posts: 154
Joined: Thu 11 Mar 2010 11:03 am
Weather Station: WH1081
Operating System: Linux, Raspberry Pi (Wheezy)
Location: Port Huon, Tasmania , Australia
Contact:

scp instead of ftp

Post by tumutbound »

Due to circumstances beyond my control, I can no longer ftp from CumulusMX to my Internet website. Network congestion is causing all ftp connection attempts to timeout
I can however use ssh/scp to copy the necessary files.

I can call a script from CumulusMX to do the ssh/scp copy but if I don't have ftp enabled in CumulusMX, the various web files do not get updated form the templates (true?)
Is there a way to have the various .htm files and .json files etc. updated without having ftp enabled?

This problem is likely to exist until the end of May so I don't mind putting in some effort to fix this.

Regards
Geoff
My weather
CumulusMX (3036)
Raspberry Pi: Wheezy
FineOffset WH1081
User avatar
steve
Cumulus Author
Posts: 26702
Joined: Mon 02 Jun 2008 6:49 pm
Weather Station: None
Operating System: None
Location: Vienne, France
Contact:

Re: scp instead of ftp

Post by steve »

MX processes templates and creates the json files without requiring ftp to be configured. To disable ftp, just set it up as normal but don't supply an ftp host.
Steve
tumutbound
Posts: 154
Joined: Thu 11 Mar 2010 11:03 am
Weather Station: WH1081
Operating System: Linux, Raspberry Pi (Wheezy)
Location: Port Huon, Tasmania , Australia
Contact:

Re: scp instead of ftp

Post by tumutbound »

Thanks Steve,
I did try deleting all of the ftp info but got an error message. Just tried with the host blank and it isn't complaining.

Another question on the same/related subject. I need to run a script to perform the scp. I've entered the name of this script into the External Program section under Internet Settings but it's either not being run or isn't doing the job. If I run the script as root, it works fine. I've tried this using just the script file-name and also with a full pathname.
Is the script run before or after the ftp transfer/file processing takes place?

Regards
GEoff
My weather
CumulusMX (3036)
Raspberry Pi: Wheezy
FineOffset WH1081
User avatar
steve
Cumulus Author
Posts: 26702
Joined: Mon 02 Jun 2008 6:49 pm
Weather Station: None
Operating System: None
Location: Vienne, France
Contact:

Re: scp instead of ftp

Post by steve »

If you turn on debug logging, the diags file will contain a message if/when it starts the command (one message before and one after starting), and any error will be logged (even without debug logging). Sometimes the command can fail in such a way that MX doesn't get told, though.

The command is executed after file processing and before FTP.
Steve
tumutbound
Posts: 154
Joined: Thu 11 Mar 2010 11:03 am
Weather Station: WH1081
Operating System: Linux, Raspberry Pi (Wheezy)
Location: Port Huon, Tasmania , Australia
Contact:

Re: scp instead of ftp

Post by tumutbound »

Logging is on, ftp host is set to null and the files are correctly processed.
The log tells me that the external program has been run but it doesn't appear to be.

Code: Select all

2016-03-12 23:20:02.870 Executing program /home/weather/CumulusMX/weather_copy.sh testing
2016-03-12 23:20:02.887 External program started
The program is as basic as I can make it, list is a file with the names of the files to transfer. Program parameters is set to 'testing'

Code: Select all

scp -P 2783 `cat list` user@port-huon.com.au:~/hub/weather
echo $1 >>/tmp/logg
Running the script as either the weather user or root works as expected.

Any other debugging I can try?
My weather
CumulusMX (3036)
Raspberry Pi: Wheezy
FineOffset WH1081
User avatar
mcrossley
Posts: 12695
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: scp instead of ftp

Post by mcrossley »

Try your echo as the first line of the script. I have MX running a shell script, daily rather than at update, but it works fine...
Untitled-1.jpg
You do not have the required permissions to view the files attached to this post.
tumutbound
Posts: 154
Joined: Thu 11 Mar 2010 11:03 am
Weather Station: WH1081
Operating System: Linux, Raspberry Pi (Wheezy)
Location: Port Huon, Tasmania , Australia
Contact:

Re: scp instead of ftp

Post by tumutbound »

Thanks Mark, I'll make that change and see what happens.

EDIT: No change, still no output from program. FWIW, I'm running CumulusMX 3036

Regards
GEoff
My weather
CumulusMX (3036)
Raspberry Pi: Wheezy
FineOffset WH1081
tumutbound
Posts: 154
Joined: Thu 11 Mar 2010 11:03 am
Weather Station: WH1081
Operating System: Linux, Raspberry Pi (Wheezy)
Location: Port Huon, Tasmania , Australia
Contact:

Re: scp instead of ftp

Post by tumutbound »

Doh!

I can't believe it, I forgot to put the magic #!/bin/sh as the first line of the shell script!

Script now works as expected and data is being uploaded to my web pages.
My weather
CumulusMX (3036)
Raspberry Pi: Wheezy
FineOffset WH1081
Locked