|
|
Mac OS X Hints -
It's magic. I tried your syntax and it worked. now I have to go through the painful process of learning wy mine *didn't* work.
Why it didn't work for you.
Nothing magical - just shell choice.
You see, you used your own crontab (via crontab -e) to enter the script, but used the "setiathome > /dev/console 2> /dev/console" syntax to redirect stdout and stderr. The problem lies in the fact that your default shell is tcsh, and using 2> to redirect stderr only works for Bourne-style shells (sh/ksh/bash/etc). By putting in /etc/crontab, you got it to work because there is a line in /etc/crontab that says "SHELL=/bin/sh", so the 2> redirect works. There are three ways you can fix your script so you can leave your system crontab alone. I recommend using one of them, rather than futzing with /etc/crontab, since the system crontab may get overwritten when you reinstall, and in general you don't want to mess with system stuff. 1) Bring your script into csh compliance. Use "setiathome >& /dev/console" to merge stdout and stderr . 2) Make your crontab use a Bourne shell. Use Cronnix to set the SHELL environment variable to /bin/sh, or edit it yourself to include the line SHELL=/bin/sh 3) Have crontab call a standalone script. (Recommended) Make a file titled "Start.sah" or something similar. Put in it something like the following: #!/bin/sh /path/to/setiathome -nice 19 > /dev/console 2> /dev/console echo "Seti@Home started" > /dev/consoleAs stated, I recommend using option 3, in conjunction with the following trick. Put your crontab in ~/Library/init/crontab.mine. Use "crontab ~/Library/init/crontab.mine" as a command line alias (i.e. update_crontab). I don't think this works with CronniX, but it is nice, since the "permanent" copy of your crontab will live in your user directory, and thus will not get hosed when you move your User directory around for backup or reinstall purposes. |
SearchFrom our Sponsor...Latest Mountain Lion HintsWhat's New:HintsNo new hintsComments last 2 daysNo new commentsLinks last 2 weeksNo recent new linksWhat's New in the Forums?
Hints by TopicNews from Macworld
From Our Sponsors |
|
Copyright © 2014 IDG Consumer & SMB (Privacy Policy) Contact Us All trademarks and copyrights on this page are owned by their respective owners. |
Visit other IDG sites: |
|
|
|
Created this page in 0.17 seconds |
|