13 October 2011
1. add job to crontab

(crontab -u fayland -l ; echo "*/5 * * * * perl /home/fayland/test.pl") | crontab -u fayland -

2. remove job from crontab

crontab -u fayland -l | grep -v 'perl /home/fayland/test.pl'  | crontab -u fayland -

3. remove all crontab

crontab -r

nothing is tricky. expect it took me 10 minutes to figure out '-' is the one I want. (- is STDOUT in Linux).

Thanks.


blog comments powered by Disqus