Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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???
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.
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
...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.
...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.
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
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.
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.
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.
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
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.