Mailing List Archive


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

Re: [tlug] Crontab not executing



--- Dave M G <martin@example.com> wrote:

> TLUG,
> 
> I have a shell script that I want to run once daily
> at 12 PM (noon) 
> every day. The shell script is of my own creation,
> and it works when I 
> execute it from the command line.
> 
> However, it's not successfully being executed by
> cron.
> 
> Here is what I put into my crontab file:
> 
> 0 12 * * * sh /home/dave/myShellScript.sh
> 
> Have I messed up my syntax or something?
> 

Dave,

   I usually create a corresponding "cron log" for a
crontab script which could be something like this
using your example (of course below is a single line,
just wrapped by the email program in this case):

0 12 * * * sh /home/dave/myShellScript.sh >
/tmp/myShellScript.sh_cron.log 2>&1

   If there is no script "cron.log" output in /tmp
that would indicate the script isn't being executed
(examples - cron not running, pathing problem of the
script itself). If the script is being executed, then
errors from it should appear in the log file which
most probably would help to debug it. 

   By temporarily adding -vx (either within the script
itself or to the sh in the crontab entry) will provide
more information if needed.

Mike 

> -- 
> Dave M G
> Ubuntu 6.10 Edgy Eft
> Kernel 2.6.20-5-generic
> Pentium D Dual Core Processor
> PHP 5, MySQL 5, Apache 2
> 
> -- 
> To unsubscribe from this mailing list, 
> please see the instructions at
> http://www.tlug.jp/list.html
> 
> Please visit our sponsor at
> http://www.primustel.co.jp/tlug/
> 



Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links