Mailing List Archive
tlug.jp Mailing List tlug archive tlug Mailing List Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]Re: [tlug] Crontab not executing
- Date: Sun, 25 Mar 2007 09:39:51 +0900
- From: "Edmund Edgar" <lists@example.com>
- Subject: Re: [tlug] Crontab not executing
- References: <4605B81F.4010702@example.com>
Morning Dave.
You generally want to include the full path in commands you use in your cron.
sh would normally live in /bin, so you'd need something like:
0 12 * * * /bin/sh /home/dave/myShellScript.sh
The above should successfully run the script, although it's a bit long.
You may also want to check that you're using the full path of commands you use inside the script. Otherwise the script may run, but not do what you want. (All this is necessary because the cron runs with a different set of environment variables to your regular shell.)
The more conventional way to do it would be to skip the initial sh altogether. Normally, the first line of your shell script would be
#!/bin/sh
and the script would have its execute permissions turned on (chmod +x myShellScript.sh to make it executable) so you can call it on its own like this:
0 12 * * * /home/dave/myShellScript.sh
Hope that helps,
Edmund
- References:
- [tlug] Crontab not executing
- From: Dave M G
Home | Main Index | Thread Index
- Prev by Date: Re: [tlug] Crontab not executing
- Next by Date: Re: [tlug] Crontab not executing
- Previous by thread: Re: [tlug] Crontab not executing
- Next by thread: Re: [tlug] Crontab not executing
- Index(es):
Home Page Mailing List Linux and Japan TLUG Members Links