crand cannot automaticlly work problem
In mips enbedded system, i want to do someting periodically, but it cannot work. the code is as follow.
autochannel.sh /**********************************************/ #!/bin/sh /sbin/iwconfig ath0 channel 0 /**********************************************/ autochannelschedule /**********************************************/ */1 * * * * /bin/sh /etc/autochannel.sh /**********************************************/ in my main process, the code is /**********************************************/ systemf("echo \' %s /bin/sh /etc/autochannel.sh \' > /tmp/autochannelschedule"," */1 * * * *"); system("chmod 777 /tmp/autochannelschedule"); system("/usr/bin/crontab -d"); system("/usr/bin/crontab /tmp/autochannelschedule"); system("killall -9 crond && /usr/sbin/crond"); /**********************************************/ after system up, i use "crontab -l", the echo is "*/1 * * * * /bin/sh /etc/autochannel.sh" . Can someone tell me what's the problem? Thanks. |
Quote:
Code:
echo '*/1 * * * * root /sbin/iwconfig ath0 channel 0' > /etc/cron.d/iwsetchan.cron Code:
umask 027; /usr/bin/crontab -u root -l|grep -v iwconfig > /tmp/.crontab //NTLB |
Thanks. I had fixed the problem.
But I didn't know the reason. I just modified the crontab file again and again, then test it. Then It worked. |
All times are GMT -5. The time now is 08:55 PM. |