Thread: Cron question

    #1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2004
    Posts
    488
    Rep Power
    12

    Cron question


    Hi there. What does "> /dev/null 2>&1" do and does anyone have a good tutorial on cron so I can read up?

    */5 * * * * lynx -dump 'script.php' > /dev/null 2>&1
  2. #2
  3. No Profile Picture
    Lost in code
    Devshed Supreme Being (6500+ posts)

    Join Date
    Dec 2004
    Posts
    8,317
    Rep Power
    7170
    It discards the output of the script. It's actually a feature of the shell, not CRON. > redirects the program's normal output, /dev/null is a special location that simply discards everything that is written to it, 2> redirects the program's error output, &1 means to redirect to the same location as normal output.

    Comments on this post

    • nikko50 agrees
    PHP FAQ

    Originally Posted by Spad
    Ah USB, the only rectangular connector where you have to make 3 attempts before you get it the right way around

IMN logo majestic logo threadwatch logo seochat tools logo