Hi everyone, I already know how to turn the leds on and off and have the led control webpage installed. But what I'd really like to do is setup a way for my mybook to turn off its leds at night (eg between 10pm and 7am).
I thought that i might be able to do this with cron.. but I dont seem to be able to get it to work… (you only have to do a /etc/init.d/crond.sh stop and start after each edit to update it don't ya? nothing else?)
this is the code i have to turn the leds on and off:
turn leds off - echo 0 > /sys/class/leds/wdc-leds:power/brightness turn leds on - echo 255 > /sys/class/leds/wdc-leds:power/brightness
now I know this code works, but when I try to put it into /etc/crontabs/root it doesnt seem to be working…
Here is my root file:
# standard crontab format for busybox cron daemon. # fields may be lists # min hour day month wd command # * * * * * dosomething # save the date every day at midnight 0 0 * * * date +%m%d%H%M%Y.%S > /var/lib/now #Run MyCheck every 5 min 0,15,30,45 * * * * /shares/internal/PUBLIC/WWW/Welcome/Mycheck/mycheck.sh #turn off leds at 10pm * 22 * * * echo 0 > /sys/class/leds/wdc-leds:power/brightness #turn on leds at 7am * 7 * * * echo 255 > /sys/class/leds/wdc-leds:power/brightness
Im sure that because I havent done cron jobs before, that im doing it wrong, but can someone please point me in the right direction?? From how I read the setup at the top of that file it seems that I should just be able to specify an hour or minute and hour and then it'll run the command..
I've also edited /root/.bashrc to setup two alias's called 'ledson' and 'ledsoff'. Shouldn't I be able to reference these commands in this cron file?