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] Efficiently executing a cron job on my webhosting server
- Date: Sat, 7 Jul 2007 14:12:45 +0900
- From: "Josh Glover" <jmglov@example.com>
- Subject: Re: [tlug] Efficiently executing a cron job on my webhosting server
- References: <7d27112b0707052020h293cbf71se22c91761135d686@mail.gmail.com> <468ECC22.2010707@dcook.org> <468ED44E.6070309@sonic.net> <7d27112b0707062041g3a1b5c1fq9c68935278d277e1@mail.gmail.com> <468F16D7.2010205@sonic.net>
On 07/07/07, steven smith <sjs@example.com> wrote:
Dave Gutteridge wrote:
> I'd like for it to not send me anything except error notification. Is that > possible?
It depends on what your control panel will allow you to do. Probably errors get sent to stderr so to loose that you would redirect stderr to /dev/null. This is easy to do from crontab, but I don't know your control panel.
Make sure your scripts only produce output on error. This sometimes requires a trivial wrapper script:
#!/bin/sh
CMD="/full/path/to/my/script arg1 arg2 ... argn" TMP_FILE=/tmp/`basename "${CMD}"`.`date +'%Y-%m-%d_%H-%M-%S'`
${CMD} 2>&1 >"${TMP_FILE}" retval=$?
if test ${retval} -ne 0; then cat "${TMP_FILE}"; fi
rm "${TMP_FILE}" exit ${retval}
-- Cheers, Josh
- References:
- [tlug] Efficiently executing a cron job on my webhosting server
- From: Dave Gutteridge
- Re: [tlug] Efficiently executing a cron job on my webhosting server
- From: Darren Cook
- Re: [tlug] Efficiently executing a cron job on my webhosting server
- From: steven smith
- Re: [tlug] Efficiently executing a cron job on my webhosting server
- From: Dave Gutteridge
- Re: [tlug] Efficiently executing a cron job on my webhosting server
- From: steven smith
Home | Main Index | Thread Index
- Prev by Date: Re: [tlug] Switching from UIM to SCIM
- Next by Date: [tlug] Geeky Sci-Fi
- Previous by thread: Re: [tlug] Efficiently executing a cron job on my webhosting server
- Next by thread: Re: [tlug] Efficiently executing a cron job on my webhosting server
- Index(es):
Home Page Mailing List Linux and Japan TLUG Members Links