save weather radar to local time-named file every 15 minutes

I think I can do this myself now, but I am always amazed by how people can do things cleaner and simpler than I end up doing...

Using cron, I want to save the image found at:

every 15 minutes to a local file , such as

/home/bruce/radarpics/2008-06-14_23:15.gif

Some Nuggets I've found so far:
#!/bin/sh -xv
# TEST - Assign Date Value to Variable
d='date +%y%m%d%H%M%S'
echo $d
file="file_$d"
echo $file

The format I would want is:
date -d "-10 seconds" "+%H:%M:%S"

So, what do you think is the BEST way to do this??

(I just discovered this board, but very impressed by the traffic and knowledge I've seen so far!)

Hi,

Welcome on this forum.

You almost got it. If you want to affect the result of a command to a variable, you need to use either the backticks (not the quote) var=`command` or the var=$(command) form. The latest having the advantage to permit imbedded commands: var=$(command1 $(command2)).

So, the line that affects the date to your variable d should look like:

d=`date +%y-%m-%d_%H%M`
# or
d=$(date +%y-%m-%d_%H%M)

To execute your script every 15 minutes, use cron (man cron).