LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-15-2009, 09:14 AM   #1
mahmoud
Member
 
Registered: Apr 2006
Location: UK
Distribution: Mandriva, Debain, Redhat, Fedora, Ubuntu, FreeBSD
Posts: 269

Rep: Reputation: 30
mtr


Hi
i have a script to run a couple of commands but it doesnt run mtr
from the cron jon
when i run the script manualy it works but when its in the cron it doesnt
here is the command
mtr -n -p -c 2 192.168.2.1 >> /file/
has anyone had this same problem and can anyone help
 
Old 04-15-2009, 09:16 AM   #2
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976
As a general rule, you have to use the full path of the commands inside a cron job, since the crontab has a very limited environment and the PATH variable is usually limited to /bin:/usr/bin. Put the full path to mtr and it should work from the crontab as well.
 
Old 04-20-2009, 11:54 AM   #3
mahmoud
Member
 
Registered: Apr 2006
Location: UK
Distribution: Mandriva, Debain, Redhat, Fedora, Ubuntu, FreeBSD
Posts: 269

Original Poster
Rep: Reputation: 30
Hi
Thanks for that its works but it keeps running even with the option for only 1 count
/usr/sbin/mtr -r -n -p -c 1 192.168.2.2
 
Old 04-20-2009, 01:06 PM   #4
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 17,916

Rep: Reputation: 3689Reputation: 3689Reputation: 3689Reputation: 3689Reputation: 3689Reputation: 3689Reputation: 3689Reputation: 3689Reputation: 3689Reputation: 3689Reputation: 3689
Quote:
Originally Posted by mahmoud View Post
Hi
Thanks for that its works but it keeps running even with the option for only 1 count
/usr/sbin/mtr -r -n -p -c 1 192.168.2.2
Right...based on your command line, it would. Did you read the MAN page for mtr?

-i is the interval in seconds, between ICMP requests. 1 second is the default.
 
Old 04-20-2009, 03:59 PM   #5
john test
Member
 
Registered: Jul 2008
Distribution: ubuntu 9.10
Posts: 527
Blog Entries: 1

Rep: Reputation: 35
Could it have something to do with cron job iterations? The -c 1 option runs the command a single time.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
I don't understand the mtr (my traceroute) output Durham Linux - Networking 3 05-07-2008 03:01 AM
mtr display mode question szandor Linux - Newbie 1 11-11-2007 02:10 PM
mtr / traceroute confusion :( gottin Linux - Networking 3 09-28-2004 01:59 AM
If I use MTR when SUed into root, am I at risk on the net? eBopBob Linux - Software 1 08-24-2004 01:47 PM
traceroute or mtr Alien18 Linux - Newbie 0 05-26-2004 09:50 PM


All times are GMT -5. The time now is 10:55 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration