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] Completely baffled as to why Cron job is not working
- Date: Thu, 1 Nov 2007 13:07:36 +0900
- From: "Keith Bawden" <keith@example.com>
- Subject: Re: [tlug] Completely baffled as to why Cron job is not working
- References: <47284ED9.1020106@autotelic.com> <47292C00.5050405@samsara.bebear.net> <47293552.4030902@dcook.org>
On 11/1/07, Darren Cook <darren@example.com> wrote: > > Because the environment cron is running it in is different. ... > > My favourite way to get around this is to put something like this in > your crontab: > 16 8 * * * /bin/bash -c "cd /path/to/script/;php my_script.php" Another way is to use full paths within your script, or to set up the environment you need as part of the script. Some things you can do to get a "feel" for how your script will run under cron is to use the "env" command when running from the command line. For example: /usr/bin/env -i /home/mythtv/myscript.sh That will run your script in a "clean" environment. You can then watch for errors and correct accordingly. Also, when running a new cronjob you can do the following to log stdout and stderr to a file: 0 13 * * * /home/mythtv/myscript.sh &> /home/mythtv/myscript.log Then looking at /home/mythtv/myscript.log after a run will show you the output of the script (standard and error). Regards, Keith
- References:
- [tlug] Completely baffled as to why Cron job is not working
- From: Dave M G
- Re: [tlug] Completely baffled as to why Cron job is not working
- From: emiddleton@example.com
- Re: [tlug] Completely baffled as to why Cron job is not working
- From: Darren Cook
Home | Main Index | Thread Index
- Prev by Date: [tlug] Website design: search engine indexing: test with lynx
- Next by Date: Re: [tlug] Feedback needed (i.e., website design): KISS
- Previous by thread: Re: [tlug] Completely baffled as to why Cron job is not working [SOLVED]
- Next by thread: Re: [tlug] License of Arial Unicode MS (Arialuni.ttf)
- Index(es):
Home Page Mailing List Linux and Japan TLUG Members Links