[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Sheflug] Help with non-functioning cron job




And Lo! The Great Prophet " David Morris" uttered these words of wisdom...
> I've got a cron job that pulls data into an mySQL database. The cron job
> simply executes a script. The script works fine if I run it from a bash
> shell, but if I move the script over to cron, I think it starts to
> execute, but never seems to do anything. I know it starts because the line
> in the crontab says:
>
> 05 13 * * * /david/database/getdata.smb > /tmp/databaseimport.log
>
> ...and /tmp/databaseimport.log is being updated.

No direct answer, but something that'll improve your logging...try adding
the magic incantation "2>&1" at the end of the line (so you'll have:
"... > /tmp/databaseimport.log 2>&1"). Thiss ensure stderr also gets sent to
your log file :)

This may give some indication of why mysql falls over if it sends its errors
to stderr.

The text sent to stderr (and stdout if that isn't redirected) will end up in
$USER's mailbox usually.

Chris...

-- 
\ Chris Johnson                 \
 \ cej [at] nightwolf.org.uk          \
  \ http://cej.nightwolf.org.uk/  ~-----------------------------------+
   \ Redclaw chat - http://redclaw.org.uk - telnet redclaw.org.uk 2000 \____



___________________________________________________________________

Sheffield Linux User's Group -
http://www.sheflug.co.uk/mailfaq.html

  GNU the choice of a complete generation.