Originally Posted by leon.zcom
Can someone tell me what's the problem?
No because we don't know the user you execute commands as (who's crontab this is) and we haven't seen cron log (error) entries or emailed output. Depending on your crond version
0) the cron daemon should pick up crontab changes automagically and a static task like yours may be 1) dumped in /etc/cron.d/:
echo '*/1 * * * * root /sbin/iwconfig ath0 channel 0' > /etc/cron.d/iwsetchan.cron
or 2) loaded from a temporary crontab (as mucking with /var/spool/cron/ files isn't SOP) like you already showed:
umask 027; /usr/bin/crontab -u root -l|grep -v iwconfig > /tmp/.crontab
echo '*/1 * * * * root /sbin/iwconfig ath0 channel 0' >> /tmp/.crontab
/usr/bin/crontab -u root /tmp/.crontab; rm -f /tmp/.crontab
The difference here is I specify a crontab user instead of assuming it, modify the existing crontab instead of replacing it and don't restart crond because it picks up crontab changes automagically. That leaves the question why on earth you would want to schedule this particular command to run every minute but then again it's your system...