Cronjob problem

37 views
asked Nov 23, 2012 in General by darkshark (1,500 points)
I have  recently created a a simple cron job with the bellow code
tethereal -i eth0 -w /home/Mypage-captures/capture.pcap -a duration:78000 -b filesize:51100

When I try executing the code with a cron I get the message Command not found, but if I try to run it using SSH it runs normally.
Any idea why is this happening with the cron job? Any ideas will be appreciated.
 Many thanks

2 Answers

0 like 0 dislike
answered Nov 23, 2012 by expert (14,380 points)
I think your problem is caused because of the paths.  Try using full paths.
0 like 0 dislike
answered Nov 23, 2012 by FixHost (12,380 points)
Add this the below code to your crontab:
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/root:.
...