LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 07-11-2016, 02:30 PM   #1
thomazp
Member
 
Registered: Dec 2015
Location: Brazil
Distribution: Ubuntu, Fedora
Posts: 161

Rep: Reputation: Disabled
Is the command in the contrab running?


I put the line
*/5 * * * * root export LANG=C /usr/bin/mrtg /root/file.cfg --logging /var/log/mrtg.log
But neither the out is been created, nor the log indicated created.
What I am doing wrong ?
Is there another way verify it's run except ls -ltr in the output directory!
Thanks

Last edited by thomazp; 07-11-2016 at 03:12 PM. Reason: Correcting question.
 
Old 07-11-2016, 03:38 PM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,637

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by thomazp View Post
I put the line
*/5 * * * * root export LANG=C /usr/bin/mrtg /root/file.cfg --logging /var/log/mrtg.log
But neither the out is been created, nor the log indicated created.
What I am doing wrong ? Is there another way verify it's run except ls -ltr in the output directory!
Thanks
You can, as you've been told about TWO DOZEN TIMES now, in the THREE OTHER THREADS you've opened about MRTG:

READ THE DOCUMENTATION

It DOES NOT get simpler than that. AGAIN, as you were told several times, you have NOT specified a correct cron statement. It is badly mangled...if you looked at the documentation (posted here AGAIN, for the fifth time):
http://oss.oetiker.ch/mrtg/doc/mrtg-unix-guide.en.html

...and actually READ IT, you will see, towards the bottom, a very clear cron line example. Look at it..compare it to yours...the one THEY have works. It STILL doesn't get simpler than that. A cron job has SIX fields total...the last being the command. Unless you can type in "root export LANG=C /usr/bin/mrtg /root/file.cfg --logging /var/log/mrtg.log" on a command line and have it work (and it WILL NOT), why do you think it'll work in cron???
 
1 members found this post helpful.
Old 07-11-2016, 04:00 PM   #3
thomazp
Member
 
Registered: Dec 2015
Location: Brazil
Distribution: Ubuntu, Fedora
Posts: 161

Original Poster
Rep: Reputation: Disabled
I will read when arrive home, but I am out of office now.
Thanks
 
Old 07-11-2016, 05:18 PM   #4
thomazp
Member
 
Registered: Dec 2015
Location: Brazil
Distribution: Ubuntu, Fedora
Posts: 161

Original Poster
Rep: Reputation: Disabled
Easy,
I tried ask that.
My Cron wasn`t running.
It`s only: # service crond start .
Thanks for send the sites.
Tomorrow I send the results.
 
Old 07-11-2016, 07:14 PM   #5
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,637

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by thomazp View Post
Easy,
I tried ask that.
Ask WHAT? Where? In which of the multiple threads, where you didn't answer questions??
Quote:
My Cron wasn`t running.
It`s only: # service crond start .
Bull...I've NEVER seen any modern Linux distro that didn't ship with CRON already enabled and running.
Quote:
Thanks for send the sites.
Tomorrow I send the results.
Don't, please...no need to. Everyone pretty much can set up MRTG in minutes. Also, there is *NO WAY* that cron statement you posted will run, period. Again, you're not posting accurate information.
 
1 members found this post helpful.
Old 07-12-2016, 05:30 AM   #6
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
http://oss.oetiker.ch/mrtg/doc/mrtg-unix-guide.en.html
 
1 members found this post helpful.
Old 07-12-2016, 07:30 AM   #7
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,637

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by Habitual View Post
Yep...handed that to OP three times so far. Apparently, not been read/understood.
 
Old 07-12-2016, 07:59 AM   #8
thomazp
Member
 
Registered: Dec 2015
Location: Brazil
Distribution: Ubuntu, Fedora
Posts: 161

Original Poster
Rep: Reputation: Disabled
The service was up, and I restarted it.
But the file /tmp/debug.log is full with the error: /bin/sh: root: command not found.
It's strange because I can start by command line.
Any suggestion?
Thanks
 
Old 07-12-2016, 08:17 AM   #9
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,637

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by thomazp View Post
The service was up, and I restarted it.
...and if it was UP, there was no need to restart it. Also, you SPECIFICALLY SAID
Quote:
Originally Posted by thomazp
My Cron wasn`t running.
....so which is it??? Either it WAS running, or it wasn't.
Quote:
But the file /tmp/debug.log is full with the error: /bin/sh: root: command not found.
It's strange because I can start by command line. Any suggestion?
Sorry, no...you STILL cannot run that command 'by command line'...it will not, ever, work, period.

You have been pointed to the directions/example NUMEROUS TIMES....you ARE NOT PAYING ATTENTION, and you are NOT EVEN TRYING. AGAIN, as you've been told at least half a dozen times now...READ THE DOCUMENTATION. The cron example in it is what you need to run. It does not, can not, be more simple than that. There is a command you can copy and paste, yet you REFUSE TO DO IT.

STOP POSTING if you're not going to actually do things that are suggested to you. You have been spoon-fed this information multiple times, in multiple threads, and are not listening.
 
Old 07-12-2016, 08:29 AM   #10
thomazp
Member
 
Registered: Dec 2015
Location: Brazil
Distribution: Ubuntu, Fedora
Posts: 161

Original Poster
Rep: Reputation: Disabled
Why not, only to test The syntax ?
And running by there, the graphs are being generated.
 
Old 07-12-2016, 08:33 AM   #11
thomazp
Member
 
Registered: Dec 2015
Location: Brazil
Distribution: Ubuntu, Fedora
Posts: 161

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by TB0ne View Post
...and if it was UP, there was no need to restart it. Also, you SPECIFICALLY SAID

....so which is it??? Either it WAS running, or it wasn't.

Sorry, no...you STILL cannot run that command 'by command line'...it will not, ever, work, period.

You have been pointed to the directions/example NUMEROUS TIMES....you ARE NOT PAYING ATTENTION, and you are NOT EVEN TRYING. AGAIN, as you've been told at least half a dozen times now...READ THE DOCUMENTATION. The cron example in it is what you need to run. It does not, can not, be more simple than that. There is a command you can copy and paste, yet you REFUSE TO DO IT.

STOP POSTING if you're not going to actually do things that are suggested to you. You have been spoon-fed this information multiple times, in multiple threads, and are not listening.
REMEMBER, Whenever you change the cron, you need to restart to the changes have effect.
 
Old 07-12-2016, 08:55 AM   #12
thomazp
Member
 
Registered: Dec 2015
Location: Brazil
Distribution: Ubuntu, Fedora
Posts: 161

Original Poster
Rep: Reputation: Disabled
I don't said don't need to restart.
Restart was needed to changes become taken effect.
I Read the documentation.
I copyed and paste it and are having syntax error.

Last edited by thomazp; 07-12-2016 at 09:15 AM. Reason: Correcting spelling
 
Old 07-12-2016, 09:22 AM   #13
thomazp
Member
 
Registered: Dec 2015
Location: Brazil
Distribution: Ubuntu, Fedora
Posts: 161

Original Poster
Rep: Reputation: Disabled
An user here, send me directly an email saying probably I am having problems in cron. Not in mrtg. It's possible since I could run by cmd and not using cron.
 
Old 07-12-2016, 09:47 AM   #14
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,637

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by thomazp View Post
REMEMBER, Whenever you change the cron, you need to restart to the changes have effect.
Wrong. If you use "crontab -e", there is no need to do so. You only need to restart cron if you're manually editing the crontab file (which you SHOULD NEVER DO).
Quote:
Originally Posted by thomazp
I don't said don't need to restart. Restart was needed to changes become taken effect. I Read the documentation. I copyed and paste it and are having syntax error.
Apparently you DO NOT read the documentation. Very first hit in Google for "linux adding cron job" is:
http://www.cyberciti.biz/faq/how-do-...-or-unix-oses/
...from which this is quoted:
Code:
Do I have to restart cron after changing the crontable file?
No. Cron will examine the modification time on all crontabs and reload those which have changed. Thus cron need not be restarted whenever a crontab file is modified.
Clear enough? If not, see any of the 409,000 other hits for it, which say the same thing.
Quote:
Originally Posted by thomazp
An user here, send me directly an email saying probably I am having problems in cron. Not in mrtg. It's possible since I could run by cmd and not using cron.
Which user? Because anyone here who sees what you posted, will immediately tell you that your command-line IS, and REMAINS WRONG.

You posted this, exactly:
Code:
*/5 * * * * root export LANG=C /usr/bin/mrtg /root/file.cfg --logging /var/log/mrtg.log
AGAIN, cron jobs have SIX FIELDS...the last being the command that's run. You CANNOT TYPE IN "root export LANG=C /usr/bin/mrtg /root/file.cfg --logging /var/log/mrtg.log" and have it work!!! EVER. It WILL NOT run from the command line with that syntax. Are you really this clueless???

AGAIN...from the documentation that you have been spoon-fed at least half a dozen times, which you STILL haven't read or understood, I'll even quote it here, since it may keep you from coming back:
Quote:
Originally Posted by Documentation That thomazp didn't bother to read
or if you live in Linux Land the line may look like this if you are using crontab -e

*/5 * * * * <mrtg-bin>/mrtg <path to mrtg-cfg>/mrtg.cfg --logging /var/log/mrtg.log
Do you see that??? Does it start with "root export LANG=C"???? Even your own error messages are TELLING YOU that it fails on the first word. Have you bothered to TRY WHAT IS TOLD TO YOU in the documentation??? Change the binary and config file paths in the example....that's it.

Last edited by TB0ne; 07-12-2016 at 09:55 AM.
 
1 members found this post helpful.
Old 07-12-2016, 09:56 AM   #15
thomazp
Member
 
Registered: Dec 2015
Location: Brazil
Distribution: Ubuntu, Fedora
Posts: 161

Original Poster
Rep: Reputation: Disabled
But The behavior wasn't that way.
I thought that way when editing using cron tab -e , but nothing happens, neither the log, nor any error. When used service cron restart, the things happened.
Now I have a cron error and I need to correct it.

Last edited by thomazp; 07-12-2016 at 01:55 PM.
 
  


Reply

Tags
crontab, mrtg



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
warning: at daemon not running mcaywood Linux - Newbie 2 11-15-2007 02:03 PM
at daemon not running mcaywood Linux - Newbie 3 10-17-2007 02:40 PM
Contrab schedule question? richikiki Slackware 1 07-15-2006 09:40 AM
rcpowersaved daemon is not running iskiri SUSE / openSUSE 1 01-04-2006 01:58 PM
Running in daemon mode socks Slackware 1 10-15-2004 08:27 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 07:54 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
Open Source Consulting | Domain Registration