Welcome to the new home of the Cumulus Support forum.

Latest Cumulus release v1.9.4 (build 1099) - 28 November 2014
Latest Cumulus MX release v3.0.0 build 3046 - 02 January 2019. See the Wiki for download

CumulusMX - RaspberyPi - Start|Stop|Restart Script V2.5.5.0

Discussion of version 3 of Cumulus, which runs on Windows, Linux, and OS X. All Cumulus MX queries in here, please.

Moderator: mcrossley

jank
Posts: 310
Joined: Sat 13 Jun 2015 5:57 pm
Weather Station: weatherstation
Operating System: Debian Wheezy
Location: Germany

Re: CumulusMX - RasperryPi - Start|Stop|Restart Script V2.5

Post by jank » Fri 08 Jul 2016 9:47 am

Hello Richard
thanks for this screenshot. This looks okay.
It is very difficult to find problems only based on some screenshots, but I will not give up.
We know, the init script in /etc/init.d/cumulusmx is being started at boot.
I know this, because the error you described was caused by the CumulusMX start stop script.
I know, you can start CumulusMX with the init Scrpt when system is booted (/etc/init.d/cumulusmx force-reload)

Please do the following
1)
grep -i cumulusmx /var/log/syslog
There are 2 lines, when the init script is being started during boot.
At least for me, I see this
Jul 8 11:28:22 cumulus cumulusmx[458]: Jul 08 11:28:21 CumulusMX init.d-Script: CumulusMX is being started at system boot within 0 seconds
Jul 8 11:29:07 cumulus cumulusmx[458]: Starting CumulusMX...
Jul 8 11:29:07 cumulus systemd[1]: Started LSB: Start cumulusmx.sh (CumulusMX) at boot time.


Did you see these lines ?
2) Delete the CumulusMX logfiles and reboot
/home/cumulus/CumulusMX/cumulusmx.sh -q --> This will stop Cumulusmx
rm /home/cumulus/CumulusMX/cumulusmxsh.log ---> This will clear the Logfile
reboot ---> Will reboot the Pi

Once it is up again, do things I described in Step 1)
and please also send a copy/screenshot of the cumulusmxsh.log
cat /home/cumulus/CumulusMX/cumulusmxsh.log

I think these thoings are too complicated to do them on a Android mobile phone....so you should think about a "real" SSH access using putty.exe to the system ?
Want to see your Station values on SSH? Cumulusnow http://sandaysoft.com/forum/viewtopic.php?f=27&t=14062
Want a Start|Stop|Restart Script for CumulusMX on RaspberryPi? cumulusmx.sh http://sandaysoft.com/forum/viewtopic.php?f=27&t=13767

User avatar
VTHokie74
Posts: 130
Joined: Tue 10 Apr 2012 12:58 am
Weather Station: Davis Vantage Pro 2
Operating System: Rasbian
Location: Ashland, KY

Re: CumulusMX - RasperryPi - Start|Stop|Restart Script V2.5

Post by VTHokie74 » Fri 15 Jul 2016 2:29 pm

I decided I wanted to add a monthly backup of the CumulusMX folder on my Raspberry Pi. The reason for this is that in case the database gets corrupted and I am away all the daily backups might be corrupted. This way I could always restore from the beginning of the current month or the previous month. I borrowed from jank's crontab backup commands and added these lines at the end of the crontab file using "sudo crontab -e"

Code: Select all

# m h dom mon dow This command makes a backup of the CumulusMX directory on the first day of every month at 4 AM
00 04 01 * * sudo zip -r /home/pi/YourNetworkDrive/backup/monthly/$(date +"%Y%m%d_%H%M")_cumulusmx.zip /home/pi/CumulusMX >> /dev/null 2>&1
This command adds the date and time in the file name like jank's start-stop script does. Change the path to match the directory where you mount the network drive, for example /mmt/YourNetworkDrive/monthly/.

I set it to run at 4 am on the 1st of the month since the weekly DD backup runs at 6 am. That way if the 1st day of the month is a Sunday there will not be a conflict. I figured since this only runs monthly I could delete the old files manually. One could always write a script to auto-delete of course. A similar command using tar or gzip should work.

Some might think this is overkill but better to be safe than sorry.
Station: Davis Vantage Pro 2/CumulusMX/Raspberry Pi 3

User avatar
VTHokie74
Posts: 130
Joined: Tue 10 Apr 2012 12:58 am
Weather Station: Davis Vantage Pro 2
Operating System: Rasbian
Location: Ashland, KY

Re: CumulusMX - RasperryPi - Start|Stop|Restart Script V2.5

Post by VTHokie74 » Thu 21 Jul 2016 11:19 pm

I think there is an error in the suggested crontab entry for a weekly reboot back in the original post. The current entry is
# In case you want to reboot your RaspberryPi each sunday morning at 6:15 am
15 6 0 0 7 /usr/bin/sudo /home/pi/cumulusmx.sh -system -r >> /dev/null 2>&1
It should be (changes in red)
# In case you want to reboot your RaspberryPi each sunday morning at 6:15 am
15 6 * * 7 /usr/bin/sudo /home/pi/CumulusMX/cumulusmx.sh -system -r >> /dev/null 2>&1
Station: Davis Vantage Pro 2/CumulusMX/Raspberry Pi 3

jank
Posts: 310
Joined: Sat 13 Jun 2015 5:57 pm
Weather Station: weatherstation
Operating System: Debian Wheezy
Location: Germany

Re: CumulusMX - RasperryPi - Start|Stop|Restart Script V2.5

Post by jank » Sat 30 Jul 2016 7:22 pm

I will change it immidiately.
Want to see your Station values on SSH? Cumulusnow http://sandaysoft.com/forum/viewtopic.php?f=27&t=14062
Want a Start|Stop|Restart Script for CumulusMX on RaspberryPi? cumulusmx.sh http://sandaysoft.com/forum/viewtopic.php?f=27&t=13767

User avatar
VTHokie74
Posts: 130
Joined: Tue 10 Apr 2012 12:58 am
Weather Station: Davis Vantage Pro 2
Operating System: Rasbian
Location: Ashland, KY

Re: CumulusMX - RasperryPi - Start|Stop|Restart Script V2.5

Post by VTHokie74 » Mon 01 Aug 2016 12:31 pm

Does anyone see why this command in crontab will not execute as expected at 4 am on the first day of every month?
00 04 01 * * sudo zip -r /home/pi/routerdrive1/backup/monthly/$(date +"%Y%m%d_%H%M")_cumulusmx.zip /home/pi/CumulusMX >> /dev/null 2>&1
When I copy and paste the same command to the commend line (without the times) it works fine.
Station: Davis Vantage Pro 2/CumulusMX/Raspberry Pi 3

freddie
Posts: 350
Joined: Wed 08 Jun 2011 11:19 am
Weather Station: Davis Vantage Pro 2
Operating System: GNU/Linux (Ubuntu 18.04)
Location: Ystrad, Rhondda, Wales
Contact:

Re: CumulusMX - RasperryPi - Start|Stop|Restart Script V2.5

Post by freddie » Mon 01 Aug 2016 1:54 pm

VTHokie74 wrote:Does anyone see why this command in crontab will not execute as expected at 4 am on the first day of every month?
00 04 01 * * sudo zip -r /home/pi/routerdrive1/backup/monthly/$(date +"%Y%m%d_%H%M")_cumulusmx.zip /home/pi/CumulusMX >> /dev/null 2>&1
When I copy and paste the same command to the commend line (without the times) it works fine.
You need to supply a password when invoking sudo - which is not what you want when running a cron job. Why don't you put this in the root crontab, or place it in /etc/cron.monthly/ if you are on a Ubuntu-like system?
Freddie
Image

User avatar
VTHokie74
Posts: 130
Joined: Tue 10 Apr 2012 12:58 am
Weather Station: Davis Vantage Pro 2
Operating System: Rasbian
Location: Ashland, KY

Re: CumulusMX - RasperryPi - Start|Stop|Restart Script V2.5

Post by VTHokie74 » Mon 01 Aug 2016 2:03 pm

freddie wrote:When I copy and paste the same command to the commend line (without the times) it works fine.
You need to supply a password when invoking sudo - which is not what you want when running a cron job. Why don't you put this in the root crontab, or place it in /etc/cron.monthly/ if you are on a Ubuntu-like system?[/quote]

Thanks for the suggestions.

I am running a Raspberry Pi 3 with the latest OS version, Debian/Jessie. In the same crontab I am using jank's suggested commands for daily and weekly backups and they work using "sudo" at the beginning.They invoke the cumulusmx.sh script with parameters. I am editing the crontab as user "pi".
Station: Davis Vantage Pro 2/CumulusMX/Raspberry Pi 3

freddie
Posts: 350
Joined: Wed 08 Jun 2011 11:19 am
Weather Station: Davis Vantage Pro 2
Operating System: GNU/Linux (Ubuntu 18.04)
Location: Ystrad, Rhondda, Wales
Contact:

Re: CumulusMX - RasperryPi - Start|Stop|Restart Script V2.5

Post by freddie » Mon 01 Aug 2016 2:34 pm

VTHokie74 wrote:In the same crontab I am using jank's suggested commands for daily and weekly backups and they work using "sudo" at the beginning.
That's odd. When you use sudo on the command line, are you asked to supply a password?
VTHokie74 wrote:/home/pi/routerdrive1/backup/monthly/$(date +"%Y%m%d_%H%M")_cumulusmx.zip
If the pi user owns (or has read/write/execute permission on) /home/pi/routerdrive1/backup/monthly/ and has read access to /home/pi/CumulusMX/ then you don't need to use sudo. The command can run as the pi user.
Freddie
Image

User avatar
VTHokie74
Posts: 130
Joined: Tue 10 Apr 2012 12:58 am
Weather Station: Davis Vantage Pro 2
Operating System: Rasbian
Location: Ashland, KY

Re: CumulusMX - RasperryPi - Start|Stop|Restart Script V2.5

Post by VTHokie74 » Mon 01 Aug 2016 2:52 pm

freddie wrote:If the pi user owns (or has read/write/execute permission on) /home/pi/routerdrive1/backup/monthly/ and has read access to /home/pi/CumulusMX/ then you don't need to use sudo. The command can run as the pi user.
The permissions on the folder and subfolder where I mount the Windows shared drive are root-root. That's why I use sudo to run the command.

Edit: There is something funny going on with the Zip command. I put in simple cron command to copy a log file over to the same directory and it ran as scheduled. I preceded the copy command with sudo.
Station: Davis Vantage Pro 2/CumulusMX/Raspberry Pi 3

jank
Posts: 310
Joined: Sat 13 Jun 2015 5:57 pm
Weather Station: weatherstation
Operating System: Debian Wheezy
Location: Germany

Re: CumulusMX - RasperryPi - Start|Stop|Restart Script V2.5

Post by jank » Mon 01 Aug 2016 4:27 pm

In case your cron job des still not work please try this:

00 04 01 * * sudo /usr/bin/zip -r /home/pi/routerdrive1/backup/monthly/$(date +"%Y%m%d_%H%M")_cumulusmx.zip /home/pi/CumulusMX >> /dev/null 2>&1

the cron (as far as I know) don't have environment variables ---> path
You as use pi has /usr/bin and some more folders in your environment.
So please always use commands in cron with full path.
let me know if it works for you.
Jan
Want to see your Station values on SSH? Cumulusnow http://sandaysoft.com/forum/viewtopic.php?f=27&t=14062
Want a Start|Stop|Restart Script for CumulusMX on RaspberryPi? cumulusmx.sh http://sandaysoft.com/forum/viewtopic.php?f=27&t=13767

User avatar
VTHokie74
Posts: 130
Joined: Tue 10 Apr 2012 12:58 am
Weather Station: Davis Vantage Pro 2
Operating System: Rasbian
Location: Ashland, KY

Re: CumulusMX - RasperryPi - Start|Stop|Restart Script V2.5

Post by VTHokie74 » Mon 01 Aug 2016 5:50 pm

jank wrote:In case your cron job des still not work please try this:

00 04 01 * * sudo /usr/bin/zip -r /home/pi/routerdrive1/backup/monthly/$(date +"%Y%m%d_%H%M")_cumulusmx.zip /home/pi/CumulusMX >> /dev/null 2>&1

the cron (as far as I know) don't have environment variables ---> path
You as use pi has /usr/bin and some more folders in your environment.
So please always use commands in cron with full path.
let me know if it works for you.
Jan
That didn't work. I am not sure why because it looks like the right path to the Zip command.

What I tried next was to write a command line script I called "monthlybu.sh" with a single command in the script like this:

Code: Select all

#!/bin/bash
#  Monthly  backup
sudo zip -r /home/pi/routerdrive1/backup/monthly/$(date +"%Y%m%d_%H%M")_cumulusmx.zip /home/pi/CumulusMX
I made it executable and made the owner pi.

My crontab entry is now

Code: Select all

00 04 01 * * sudo /home/pi/CumulusMX/monthlybu.sh >> /dev/null 2>&1
I saved it in the CumulusMX directory and called that from a monthly crontab (with different times so I could see if it worked). Voila! that worked. I think the lesson here is to run only simple commands and scripts in crontab.
Station: Davis Vantage Pro 2/CumulusMX/Raspberry Pi 3

oldgraybear
Posts: 24
Joined: Fri 02 Nov 2012 4:19 am
Weather Station: Ambient Weather WS-2080
Operating System: Raspberry PI 2b
Location: Lakewood, CO

Re: CumulusMX - RasperryPi - Start|Stop|Restart Script V2.5.2.0

Post by oldgraybear » Wed 31 Aug 2016 5:41 pm

Since Steve updated his web site the current version of CumulusMX is now showing "Donate..." and producing an error on line 618

User avatar
steve
Cumulus Author
Posts: 26717
Joined: Mon 02 Jun 2008 6:49 pm
Weather Station: None
Operating System: None
Location: Vienne, France
Contact:

Re: CumulusMX - RasperryPi - Start|Stop|Restart Script V2.5.2.0

Post by steve » Wed 31 Aug 2016 6:01 pm

Sorry about that - I didn't realise (or had forgotten) that Jan's script gets the latest version from the forum page.
Steve

User avatar
VTHokie74
Posts: 130
Joined: Tue 10 Apr 2012 12:58 am
Weather Station: Davis Vantage Pro 2
Operating System: Rasbian
Location: Ashland, KY

Re: CumulusMX - RasperryPi - Start|Stop|Restart Script V2.5.2.0

Post by VTHokie74 » Wed 31 Aug 2016 9:54 pm

I had noticed that too. I am staying at 3038 unless there is a good reason to upgrade.
Station: Davis Vantage Pro 2/CumulusMX/Raspberry Pi 3

User avatar
steve
Cumulus Author
Posts: 26717
Joined: Mon 02 Jun 2008 6:49 pm
Weather Station: None
Operating System: None
Location: Vienne, France
Contact:

Re: CumulusMX - RasperryPi - Start|Stop|Restart Script V2.5.2.0

Post by steve » Thu 01 Sep 2016 8:42 am

VTHokie74 wrote:I had noticed that too. I am staying at 3038 unless there is a good reason to upgrade.
It's harder for me to support people on older versions, and later builds may include bug fixes which I haven't explicitly mentioned. As long as you are prepared to install the latest build before reporting any problem, you can use whatever version you want.
Steve

Post Reply