Questions and Answers :
Unix/Linux :
Crontab Question
Message board moderation
Author | Message |
---|---|
Joe Giampaoli Send message Joined: 14 Sep 99 Posts: 2 Credit: 4,505 RAC: 0 |
I created a crontab for boinc to run up at start up such as: * * * * * cd/boinc_dir; ./boinc_app and it runs perfectly fine, butI have a question, is the > /dev/null 2> /dev/null necessary?, and what is it for? Sorry if this question sounds dumb but I've been running LINUX for 2 weeks now. Still a newbie. Thanks. Joe Giampaoli |
TrevMeister Send message Joined: 14 May 99 Posts: 3 Credit: 356,620 RAC: 0 |
The first part, "> /dev/null", diverts "standard output" (a program's normal output) to the bit bucket (throws it out). The second part, "2> /dev/null", redirects "standard error" (a program's error messages) to the same. Without these options, every line of output generated by Boinc--and there is a quite a bit of output--would trigger an e-mail to root. If you wanted to be notified of errors, you could eliminate the "2> /dev/null" directive. |
Joe Giampaoli Send message Joined: 14 Sep 99 Posts: 2 Credit: 4,505 RAC: 0 |
Ok, thanks a lot for your help. Just to make sure the crontab line would be something like this?: * * * * * cd/my_boinc_dir; ./my_boinc_app > /dev/null 2> /dev/null Just want to make sure I'm not missing anything like a space or something else. Thanks again for your help. Joe Giampaoli |
Tony Salcedo Send message Joined: 3 Apr 99 Posts: 2 Credit: 648,503 RAC: 0 |
If I understand the crontab format correctly, the line below will try to run 'my_boinc_app' once a minute, every minute, all day long!! > Ok, thanks a lot for your help. > Just to make sure the crontab line would be something like this?: > > * * * * * cd/my_boinc_dir; ./my_boinc_app > /dev/null 2> /dev/null This line is a little better behaved: 0,15,30,45 * * * * cd /my_boinc_dir/; if ps -aux | grep -v grep | grep "boinc"; then exit; else ./my_boinc_app > /dev/null 2> /dev/null; fi It will check every 15 minutes to see if there is an active process with the string 'boinc' in it's name. If there is none, it will start 'my_boinc_app". (you may be able to simplify the begining part from '0,15,30,45' to '*/15') |
©2024 University of California
SETI@home and Astropulse are funded by grants from the National Science Foundation, NASA, and donations from SETI@home volunteers. AstroPulse is funded in part by the NSF through grant AST-0307956.