Page 1 of 1
CRON Schedule - less than 1 minute?
Posted: Wed Aug 13, 2008 6:28 am
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!
Re:CRON Schedule - less than 1 minute?
Posted: Wed Aug 13, 2008 10:32 pm
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.
Re:CRON Schedule - less than 1 minute?
Posted: Wed Aug 13, 2008 11:12 pm
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!
Re:CRON Schedule - less than 1 minute?
Posted: Thu Aug 14, 2008 10:54 am
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.
Re:CRON Schedule - less than 1 minute?
Posted: Fri Aug 15, 2008 10:36 am
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.
Re:CRON Schedule - less than 1 minute?
Posted: Wed Nov 05, 2008 11:39 pm
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
Re:CRON Schedule - less than 1 minute?
Posted: Sat Dec 27, 2008 10:36 pm
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
Re:CRON Schedule - less than 1 minute?
Posted: Sat Mar 21, 2009 6:31 pm
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
Re:CRON Schedule - less than 1 minute?
Posted: Sat Mar 21, 2009 9:25 pm
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
Re:CRON Schedule - less than 1 minute?
Posted: Sun Mar 22, 2009 2:55 am
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
Re:CRON Schedule - less than 1 minute?
Posted: Mon Mar 23, 2009 1:45 am
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