CRON Schedule - less than 1 minute?

Discussion, issues, recommendations around Meteohub's dashboard and WD Live integration

Moderator: Mattk

Post Reply
AAMFlyer
Gold Boarder
Gold Boarder
Posts: 213
Joined: Mon Aug 11, 2008 12:55 am
Location: Arvada, CO

CRON Schedule - less than 1 minute?

Post by AAMFlyer »

Does anyone know it there is a way to do a CRON schedule less than 1 mintue... Can we do something like */.5 for every 30 seconds?

Also just wondering what do people do for time variables on the other files....


Thanks!
skyewright
Platinum Boarder
Platinum Boarder
Posts: 873
Joined: Fri Jan 25, 2008 6:27 pm
Location: Isle of Skye, Scotland

Re:CRON Schedule - less than 1 minute?

Post by skyewright »

I believe that CRON can't be used to set a schedule with a frequency greater than once a minute.

I'm not sure I understand what you are asking in your other question.
AAMFlyer
Gold Boarder
Gold Boarder
Posts: 213
Joined: Mon Aug 11, 2008 12:55 am
Location: Arvada, CO

Re:CRON Schedule - less than 1 minute?

Post by AAMFlyer »

Just trying to see if I can have an option for more than 1 mintues intervals....similar to rapid fire with Wunderground....not really a big deal though as it just uses more bandwidth...and it's not like the weather changes much in a mintue... I like to watch the wind as I fly model airplanes and my house is the weather station that our club memebers use since it's close to the field...

Right now I do clientraw at every minute and was also just trying to see what others did for the 3 other files, daily, extra, and hour.....

Thanks!
skyewright
Platinum Boarder
Platinum Boarder
Posts: 873
Joined: Fri Jan 25, 2008 6:27 pm
Location: Isle of Skye, Scotland

Re:CRON Schedule - less than 1 minute?

Post by skyewright »

AAMFlyer wrote:Right now I do clientraw at every minute and was also just trying to see what others did for the 3 other files, daily, extra, and hour
Ah. I see.
Personally I use a 30 minute schedule for daily and 15 minutes for the rest, but I'm using these files with a php driven website rather than with WDL itself.
terrax
Fresh Boarder
Fresh Boarder
Posts: 10
Joined: Fri Aug 08, 2008 10:12 am

Re:CRON Schedule - less than 1 minute?

Post by terrax »

To decide what schedule might be right for the clientraw files, one might inspect what kind of information they hold.

Link: http://www.valentinois.net/forums/weath ... hp?lang=en

To my knowledge the clientraw.txt and clientrawhour.txt seem to hold timely information down to the actual minute, while clientrawextra.txt holds data for graphs with a resolution of minimum of 1 hour and and clientrawdaily.txt just hold data for daily/weekly/monthly summaries.
jhodgesatmb
Fresh Boarder
Fresh Boarder
Posts: 7
Joined: Sun Nov 02, 2008 11:05 pm

Re:CRON Schedule - less than 1 minute?

Post by jhodgesatmb »

clientraw.txt will be as up-to-date as the sampling rate it receives from the weather station during setup. The VP2 can update as quickly as 1/2.5 seconds. Using WeatherDisplay, I am ftping clientraw.txt every 20 seconds.

This cannot be done with CRON/Crontab, as mentioned, because CRON is intended for system maintenance and doesn't go down to less than 1-minute increments. What CRON is helpful for is restarting applications that crash, or perfoming some administrative duties.

Your (and my) needs really require a separate application to be launched that would make the connection to the web host and upload the file, and use CRON to start or restart it. The question is really whether MeteoHub allows other applications to be installed and launched.

Does anyone know this other than the MeteoHub author?

Jack
jhodgesatmb
Fresh Boarder
Fresh Boarder
Posts: 7
Joined: Sun Nov 02, 2008 11:05 pm

Re:CRON Schedule - less than 1 minute?

Post by jhodgesatmb »

With Boris' help I found out how to get meteohub to generate new clientraw.txt files. I wrote 2 PERL scripts, one to control the timing and invocation of the other, and the other to generate the clientraw.txt file and to ftp it up to my WDL site. Right now I am updating every 20 seconds and it is working just fine.

If anyone is interested in the scripts or process send me a note.

Jack
frammento
Fresh Boarder
Fresh Boarder
Posts: 4
Joined: Sat Mar 21, 2009 4:41 pm

Re:CRON Schedule - less than 1 minute?

Post by frammento »

Hi Jack,
I'm interested about this argument.
Could you tell me how do you get updates more quickly than one minute?
Thanks
Francesco
jhodgesatmb
Fresh Boarder
Fresh Boarder
Posts: 7
Joined: Sun Nov 02, 2008 11:05 pm

Re:CRON Schedule - less than 1 minute?

Post by jhodgesatmb »

I still use cron but only to manage the new scripts. One of the scripts starts 4 processes that gather and send the clientraw, clientrawextra, clientrawhour, and clientrawdaily files according to user-stipulated delay times. That one is a bash shell script. Cron runs it to check if the processes are running (and to restart if not), to stop them, or to start them, hourly. This makes maintenance almost non-existent. The other two scripts are perl scripts. One of them manages the delay, and the other negotiates the ftp connection and uploads the files. The three scripts are fairly heavily commented.

The reason I moved all of the clientraw files to this set of scripts is that that way I could turn off the meteohub ftp upload service and the two wouldn't interact. I still use the meteohub to upload the files to Weather Underground.

So you can see, this approach is just creating processes that keep running all day long and, at certain intervals, process the data and upload it to a site. I am currently uploading the clientraw data every 15 seconds.

Jack
frammento
Fresh Boarder
Fresh Boarder
Posts: 4
Joined: Sat Mar 21, 2009 4:41 pm

Re:CRON Schedule - less than 1 minute?

Post by frammento »

Dear Jack,
thanks for your answer and compliments for your scripts. I'm not an expert but I think your scripts read data in "raw" file in the "weather" folder and generate from them clientraw****.txt. Am I wrong? Where did you save your scripts on meteohub? In the "graph" folder? I'd like to try them onto my meteohub. Are your scripts only for personal utilization or could you send them to me?

Bye

Francesco

ps sorry if my english is not quite decent
jhodgesatmb
Fresh Boarder
Fresh Boarder
Posts: 7
Joined: Sun Nov 02, 2008 11:05 pm

Re:CRON Schedule - less than 1 minute?

Post by jhodgesatmb »

I never posted the scripts but am happy to share them with you. Just send me your email address to: jhodgesatmb@comcast.net and I'll send you an archive.

Jack
Post Reply