LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Closed Thread
  Search this Thread
Old 07-13-2016, 07:19 PM   #1
thomazp
Member
 
Registered: Dec 2015
Location: Brazil
Distribution: Ubuntu, Fedora
Posts: 161

Rep: Reputation: Disabled
My Cron doesn't execute cmd


My Rh doesn't execute command in it.
I used #crontab -e, and typed
*/5 * * * * /path/script --logging arq.log
But the cron doesn't run.
If I try the script directly, it runs normally.
What is wrong ?
 
Old 07-13-2016, 08:08 PM   #2
notKlaatu
Senior Member
 
Registered: Sep 2010
Location: Lawrence, New Zealand
Distribution: Slackware
Posts: 1,077

Rep: Reputation: 732Reputation: 732Reputation: 732Reputation: 732Reputation: 732Reputation: 732Reputation: 732
How do you know it doesn't run?

What is the `script` that you are running? (and is --logging a valid flag?)

What directory do you expect to find `arq.log` in?

As what user are you creating the cron job?

Also, isn't this literally the 7th thread in which you've asked this question?
 
Old 07-13-2016, 08:23 PM   #3
thomazp
Member
 
Registered: Dec 2015
Location: Brazil
Distribution: Ubuntu, Fedora
Posts: 161

Original Poster
Rep: Reputation: Disabled
I know it doesn't run because the log files aren't been Created. Running by hand,they appears.
The script I created with the command + options. I tried before putting the command there.
It was incomplete my post, be I put the directory + name of file (/tmp/file per example).
Created using root user.
I will continue posting until I solve the problem, maybe is the same of someone.
Tomorrow I will remove the --logging file to see below if works.
Thanks
 
Old 07-13-2016, 08:34 PM   #4
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,634

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by notKlaatu View Post
How do you know it doesn't run?

What is the `script` that you are running? (and is --logging a valid flag?)

What directory do you expect to find `arq.log` in?

As what user are you creating the cron job?

Also, isn't this literally the 7th thread in which you've asked this question?
Yes, it is thread number 7 for this guy. Despite having Jeremy tell him twice to stop. And despite having his nose rubbed into the instructions several times, and being spoon-fed the EXACT command to use twice.

Apparently, he thinks if he doesn't mention mrtg, we won't notice
 
1 members found this post helpful.
Old 07-13-2016, 08:46 PM   #5
notKlaatu
Senior Member
 
Registered: Sep 2010
Location: Lawrence, New Zealand
Distribution: Slackware
Posts: 1,077

Rep: Reputation: 732Reputation: 732Reputation: 732Reputation: 732Reputation: 732Reputation: 732Reputation: 732
Quote:
Originally Posted by thomazp View Post
I know it doesn't run because the log files aren't been Created.
That assumption is not safe.

Just because a log file isn't appearing where you think it should appear does NOT necessarily mean a cron job did not run.

It sounds like you are not familiar with how cron works. The most effective way for you to debug this is to start from the beginning: learn cron.

To learn cron, you should test it.

Try a simple cron task:

Code:
*/5 * * * * printf "cron ran `date`\n\n" >> /tmp/learn.cron.log
You see how I am hardcoding the path of the log file rather than just assuming the computer will magically know where to put it? that's important for cron jobs.

Try that. If that doesn't run, then we know the problem is with your cron system (for instance, maybe it isn't running). If it does run, then we know the problem is with your script.
 
1 members found this post helpful.
Old 07-13-2016, 08:49 PM   #6
Emerson
LQ Sage
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~amd64
Posts: 7,661

Rep: Reputation: Disabled
@notKlaatu

Sad, but I believe you are wasting your time. Our OP seems to be write-only, no reading. Reminds me old days when we did some satellite hacking. Those smartcards had write-only chips, you were not supposed to read them ...
 
2 members found this post helpful.
Old 07-14-2016, 05:55 AM   #7
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
Quote:
Originally Posted by TB0ne View Post
he thinks if he doesn't mention mrtg, we won't notice
Thread reported.
spurred from
https://www.linuxquestions.org/quest...ng-4175584353/
https://www.linuxquestions.org/quest...ab-4175584554/
https://www.linuxquestions.org/quest...on-4175584407/
https://www.linuxquestions.org/quest...on-4175584026/
https://www.linuxquestions.org/quest...em-4175582360/

Do they speak English in what?

Last edited by Habitual; 07-14-2016 at 05:58 AM.
 
1 members found this post helpful.
Old 07-14-2016, 07:13 AM   #8
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,634

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Speak it? Barely, if at all. Actually COMPREHEND things?? Unlikely, based on the now SEVEN threads opened to install MRTG. Which can be done by:
  1. Typing in "yum install mrtg"
  2. Simple editing of ONE config file (installed by the yum command)
  3. Putting in the sample cron job from the instruction page
But that appears to be FAR too much to ask of the OP.
 
Old 07-14-2016, 07:48 AM   #9
onebuck
Moderator
 
Registered: Jan 2005
Location: Central Florida 20 minutes from Disney World
Distribution: SlackwareŽ
Posts: 13,925
Blog Entries: 44

Rep: Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159
Moderator response

Please post your thread in only one forum. Posting a single thread in the most relevant forum will make it easier for members to help you and will keep the discussion in one place. This thread is being closed because it is a duplicate of these threads;
https://www.linuxquestions.org/quest...ng-4175584353/
https://www.linuxquestions.org/quest...ab-4175584554/
https://www.linuxquestions.org/quest...on-4175584407/
https://www.linuxquestions.org/quest...on-4175584026/
https://www.linuxquestions.org/quest...em-4175582360/
 
1 members found this post helpful.
  


Closed Thread

Tags
cron, execute



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to execute the python script using the cmd line in linux...? archanadubbaka Linux - Newbie 5 10-17-2011 07:09 AM
shell script using /etc/cron.hourly to execute cron.php file? rioguia Programming 3 06-11-2008 08:09 AM
cron hourly, daily, cron.d jobs don't execute eggsmartha Linux - General 3 09-17-2007 06:37 PM
Cron problem - either won't execute or doesn't mail the results - bash, Mandriva 10.2 otacon 14112 Linux - General 2 03-29-2007 03:16 AM
How can I execute a cmd on a startup ?? lab123 Linux - Networking 1 09-13-2005 12:42 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 11:49 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