LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-03-2016, 04:55 AM   #1
VPD
LQ Newbie
 
Registered: May 2016
Posts: 2

Rep: Reputation: Disabled
script to periodically download Global Forecast System (GFS) data automatically in LINUX-BASH


I am working with WRF model to forecast weather. I need to download GFS Data at a periodic interval during runtime of WRF. I am new to both LINUX and WRF. I need a script which could do the above automatically. Any help would be appreciated.
 
Old 05-03-2016, 05:03 AM   #2
Turbocapitalist
Senior Member
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 4,112
Blog Entries: 3

Rep: Reputation: 2003Reputation: 2003Reputation: 2003Reputation: 2003Reputation: 2003Reputation: 2003Reputation: 2003Reputation: 2003Reputation: 2003Reputation: 2003Reputation: 2003
You can write one easily if you know the URL of the data you want. You can do the download with "wget" or "curl", both of which are text-based web browsers with a lot of options. Probably your distro has "wget" installed by default, so I would recommend starting with that one. If the data is in a weird format, say overly-complicated XML or JSON, then you will probably want to use perl or python instead of writing a shell script.
 
1 members found this post helpful.
Old 05-03-2016, 05:34 AM   #3
VPD
LQ Newbie
 
Registered: May 2016
Posts: 2

Original Poster
Rep: Reputation: Disabled
Thank you for the immediate response.

Let me be more precise. I have a 'WRF script' to process the GFS data downloaded at a periodic interval. GFS data will have forecast file for every 6 hours. So my 'download script' should automatically download this GFS data at every 6 hours interval and it has to be linked to the 'WRF script' for processing. I think using curl or wget for downloading data automatically and continuously requires a script in which time can be incremented for each period. Kindly help me how to do this or suggest other options, if I am wrong.
 
Old 05-03-2016, 05:45 AM   #4
Turbocapitalist
Senior Member
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 4,112
Blog Entries: 3

Rep: Reputation: 2003Reputation: 2003Reputation: 2003Reputation: 2003Reputation: 2003Reputation: 2003Reputation: 2003Reputation: 2003Reputation: 2003Reputation: 2003Reputation: 2003
If the script is to be run every six hours, then cron is the way to do it. "crontab" is the name of the program you'd use to schedule that.

However, first, I'd work out the process manually with "wget" and anything else you need. Then wrap what you've done manually into a shell script. Then when that works, call it from a cron job.

Look at the long manual page for "wget" one of the options is -O, so if your script can take input via stdin, you could pipe the data from "wget"

Code:
wget -O - http://www.example.com/somepath/somefile.html | yourscript > /tmp/saveddata.gfs
 
1 members found this post helpful.
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to enter data automatically on terminal? (script BASH) MattFly Programming 4 04-27-2015 07:08 AM
[SOLVED] Bash script to check if file is present or not, check periodically every 30 mins Iyyappan Linux - Server 10 07-03-2013 05:19 AM
GFS unable (incomplete set-up) to mount automatically GNBD file system darknight1726 Red Hat 7 08-12-2008 09:57 PM
Using global variable in awk (bash script) kopeda Programming 2 04-24-2007 01:47 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:24 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration