Redirect stdout and stderr

I always hit Google to find out the exact way to redirect crontab entries. Here it is:

*/5 *   * * *   root    /home/mlambie/bin/script.sh > /dev/null 2>&1

Not anything new, but certainly useful (for me :)

3 Comments so far

  1. Hale on August 12th, 2005

    You can do this to redirect as well:

    [command] &> [filename]

    Saves some keystrokes :)

  2. Lanzon on August 15th, 2005

    Unic & C 152 revisted :)

    You know I’m only an email away for leet unix scripting hacks ;)

  3. mlambie on August 15th, 2005

    Yeah exactly Jonny. Those notes were actually pretty good I think, though Google’s made them obsolete.