Cron job won't work

itid

Verified User
Joined
Sep 27, 2004
Messages
16
Location
Newcastle East Coast Australia
Hi
I'm trying to build an archive of weather maps using cron jobs.

This is the command I'm using:

SHELL=/bin/sh wget -N -E -H -k -K -p -P /home/${HOME}/weather/$(date+%s) http://www.eldersweather.com.au/synoptic.jsp?c=d0

All that I get is an email in Maildir saying:
/bin/sh: -c: line 0: unexpected EOF while looking for matching `)'
/bin/sh: -c: line 1: syntax error: unexpected end of file

I can't see any unmatched parenthesis. Help would be much appreciated.

Cheers.
 
reason for EOF message

I found out via Google that the problem was
% is interpreted as end of line
hence end of file
and has to be escaped.

\% works

but I have other problems with this.

How can I get the script to take a PARTICULAR IMAGE file from the webpage

Also, is it possible to get the script to RENAME the image file each time

The web page names the updated file each time something like
blahblahblah_0.jpg
and i would like the script to save it as
map1.jpg, map2.jpg, map3.jpg
successively.

Can do??
 
CRON not in DirectAdmin

Well, thanks, but as CRON is one of the Advanced Tools in my DirectAdmin control panel, I thought it reasonable to ask how to get it to work.

Still seems reasonable, but I'm probably mad.

If this is incorrect, can someone tell me where I should go for an answer ??
 
Such basic things as using CRON and general scripting go out of the these forums' subjects. Of course somebody might want to help you. But you'd better do not waste your time and ask the question on any special forum.
 
What does GENERAL mean?

Okay, forgive me for intruding with my stupid question.

However, my excuse is the word "General" in the title of this forum. To me, "general" suggests that if your question doesn't obviously fit somewhere else, then it is welcome here.

I would like a moderator's opinion, but obviously I'm a rabbit who's wandered onto an airfield. I thought it was a challenging question, and yet it isn't worth considering!

I'm going elsewhere, tail between my legs. Difficult for a rabbit, of course. Thanks, and goodbye.
 
As zEitEr has pointed out, you're welcome to post here. More likelyl though, as an off-topic post (I'll leave it where it is for now), since it has nothing to do with DirectAdmin, or even with tools installed with DirectAdmin, but rather with (most likely) how you write the command you use in the cron command.

As zEitEr also points out, you're much more likely to get a good reply if you answer in a forum more likely focused on your issue. Personally, I'd not expect DirectAdmin to be the best place to ask for advice on passing arguments to Cron, while I'd consider it to be a great place to ask how to format a cron request in DirectAdmin.

We're just trying to be helpful. Your title Cron job won't work makes sense only if you're asking about how DirectAdmin runs cronjobs, not if you're asking how to use a cronjob to get the result you won't. At least in my opinion.

Jeff
 
Back
Top