LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Is the command in the contrab running? (https://www.linuxquestions.org/questions/linux-networking-3/is-the-command-in-the-contrab-running-4175584353/)

thomazp 07-11-2016 02:30 PM

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

TB0ne 07-11-2016 03:38 PM

Quote:

Originally Posted by thomazp (Post 5574267)
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???

thomazp 07-11-2016 04:00 PM

I will read when arrive home, but I am out of office now.
Thanks

thomazp 07-11-2016 05:18 PM

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.

TB0ne 07-11-2016 07:14 PM

Quote:

Originally Posted by thomazp (Post 5574323)
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.

Habitual 07-12-2016 05:30 AM

http://oss.oetiker.ch/mrtg/doc/mrtg-unix-guide.en.html

TB0ne 07-12-2016 07:30 AM

Quote:

Originally Posted by Habitual (Post 5574491)

Yep...handed that to OP three times so far. Apparently, not been read/understood.

thomazp 07-12-2016 07:59 AM

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

TB0ne 07-12-2016 08:17 AM

Quote:

Originally Posted by thomazp (Post 5574556)
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.

thomazp 07-12-2016 08:29 AM

Why not, only to test The syntax ?
And running by there, the graphs are being generated.

thomazp 07-12-2016 08:33 AM

Quote:

Originally Posted by TB0ne (Post 5574569)
...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.

thomazp 07-12-2016 08:55 AM

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.

thomazp 07-12-2016 09:22 AM

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.

TB0ne 07-12-2016 09:47 AM

Quote:

Originally Posted by thomazp (Post 5574577)
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.

thomazp 07-12-2016 09:56 AM

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.


All times are GMT -5. The time now is 09:21 PM.