Welcome to the Cumulus Support forum.

Latest Cumulus MX V4 release 4.4.2 (build 4085) - 12 March 2025

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

Legacy Cumulus 1 release 1.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

If you are posting a new Topic about an error or if you need help PLEASE read this first viewtopic.php?p=164080#p164080

Copy web files to LAN

From build 3044 the development baton passed to Mark Crossley. Mark has been responsible for all the Builds since. He has made the code available on GitHub. It is Mark's hope that others will join in this development, but at the very least he welcomes your ideas for future developments (see Cumulus MX Development suggestions).

Moderator: mcrossley

Post Reply
User avatar
KarlS
Posts: 140
Joined: Tue 30 Nov 2010 3:01 pm
Weather Station: Ecowitt GW1003 / WH32 / WH41
Operating System: 64bit Bookworm on Pi4
Location: Bridge Lake, BC, Canada
Contact:

Copy web files to LAN

Post by KarlS »

I'm running a local web server on a Win10 machine. I'd like to automatically copy the web files from the CumulusMX machine (Raspberry 4) over my LAN to the Windows server. Entering the local IP address plus path-to-local-server-files in the "Extra web files panel" and unchecking the FTP box didn't work. They ended up on the server of my ISP anyway. (I seem to remember that this worked in Cumulus 1, but I might be wrong, it was a long time ago).

Now, I'm not a Linux expert to figure out how to write a shell script/crontab job to transfer those files to my Windows server. What I could do on the Windows machine is use the command line version of WinSCP, put it into a batch/PowerShell job and run it every 10 minutes.

But maybe there is an easier solution and I just don't see it. Any help is appreciated.
User avatar
mcrossley
Posts: 14388
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Copy web files to LAN

Post by mcrossley »

The simplest way I think is to mount your Windows file share on the Linux filesystem. Then you can just specify the mount point folder in the extra files configuration and let Linux deal with the network in the background.
User avatar
KarlS
Posts: 140
Joined: Tue 30 Nov 2010 3:01 pm
Weather Station: Ecowitt GW1003 / WH32 / WH41
Operating System: 64bit Bookworm on Pi4
Location: Bridge Lake, BC, Canada
Contact:

Re: Copy web files to LAN

Post by KarlS »

Thanks Mark, that worked. At first
mount your Windows file share on the Linux filesystem
sounded a bit cryptic, but DuckDuckGo is my friend :D. Now I have to figure out how to make the mount survive a reboot. But again, the web has answers for (nearly) everything ...
User avatar
mcrossley
Posts: 14388
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Copy web files to LAN

Post by mcrossley »

The Duck knows everything! :)
User avatar
HansR
Posts: 6926
Joined: Sat 20 Oct 2012 6:53 am
Weather Station: GW1100 (WS80/WH40)
Operating System: Raspberry OS/Bookworm
Location: Wagenborgen (NL)
Contact:

Re: Copy web files to LAN

Post by HansR »

KarlS wrote: Mon 01 Feb 2021 8:11 pm Now I have to figure out how to make the mount survive a reboot.
Well, the mount does not survive the reboot, but after reboot you can test whether the other system is online

Code: Select all

if ( /sbin/showmount -e a.b.c.d )
then
  echo "The NAS is online!"

    if ( mount -t nfs -o defaults -v a.b.c.d:/volume1/WinFileShare $MNTDIR  )
or similar.

Put that in the startup of the account and you're there.
Hans

https://meteo-wagenborgen.nl
CMX build 4070+ ● RPi 4B ● Linux 6.6.62+rpt-rpi-v8 aarch64 (bookworm) ● dotnet 8.0.1
BlueSky: https://bsky.app/profile/wagenborgenwx.bsky.social
User avatar
KarlS
Posts: 140
Joined: Tue 30 Nov 2010 3:01 pm
Weather Station: Ecowitt GW1003 / WH32 / WH41
Operating System: 64bit Bookworm on Pi4
Location: Bridge Lake, BC, Canada
Contact:

Re: Copy web files to LAN

Post by KarlS »

I was thinking of putting something like

Code: Select all

@reboot sudo mount -t cifs -o username=karl //192.168.8.215/cumulus /mnt/winshare
in crontab. I will have to use a response file to supply the password though ...
freddie
Posts: 2870
Joined: Wed 08 Jun 2011 11:19 am
Weather Station: Davis Vantage Pro 2 + Ecowitt
Operating System: GNU/Linux Ubuntu 24.04 LXC
Location: Alcaston, Shropshire, UK
Contact:

Re: Copy web files to LAN

Post by freddie »

The way to persist between reboots is to add your mount details to /etc/fstab. But your method may work provided it is run with adequate privileges.
Freddie
Image
User avatar
KarlS
Posts: 140
Joined: Tue 30 Nov 2010 3:01 pm
Weather Station: Ecowitt GW1003 / WH32 / WH41
Operating System: 64bit Bookworm on Pi4
Location: Bridge Lake, BC, Canada
Contact:

Re: Copy web files to LAN

Post by KarlS »

@freddie
As I said in my original post, I'm not a Linux expert. However, I believe that if you put the Windows share in /etc/fstab, the system will not boot if the share - for whatever reason - is not present. If you try to mount it through the @reboot in crontab, it will just ignore the command when the share is not present.
Post Reply