Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have 3 cronjob set to work on reboot. When I reboot only 2 works and the 3rd one does not work. What could be stopping it from working? Where to get the clues? All of it I have redirection for the output done and there is a .log file generated for all 3. But the problematic cron job have empty log file.

EDIT From /var/log/cron

Jul 19 01:06:08 itest CROND[2155]: (root) CMD (/home/test1/PF_RING-5.4.3/userland/examples/packetSecondAnalyis.c -m 2>&1 >> /var/log/myPacketeSecondAnalyis.log)

Jul 19 01:06:08 itest CROND[2154]: (root) CMD (/home/test1/PF_RING-5.4.3/userland/examples/pfExeV3.c -m 2>&1 >> /var/log/myPacketCapture.log)

Jul 19 01:06:08 itest CROND[2156]: (root) CMD (/home/test1/PF_RING-5.4.3/userland/examples/pAR.c -m 2>&1 >> /var/log/myPAR.log)

Issue now is crond[2156] is not running. I have checked using top command also not there?

share|improve this question
1  
Take a second to re-read this question, please. There are no meaningful details, how could anyone here possibly answer this? Take a read of How to Ask and edit this to have more information please. A good start would be the contents of your crontab. –  MDMarra Jul 18 '12 at 17:12

1 Answer 1

Check your /var/log/cron for interesting messages.

When you do >> you are only redirecting stdout you may need to catch stderr too e.g.

@reboot root  somecommand &>/tmp/logfile.log

Edit: you have the syntax for your redirect wrong try

@reboot root /home/test1/PF_RING-5.4.3/userland/examples/pAR.c -m >> /var/log/myPAR.log 2>&1 

or

@reboot root /home/test1/PF_RING-5.4.3/userland/examples/pAR.c -m &> /var/log/myPAR.log 
share|improve this answer
    
should I change my crontab line to @reboot root somecommand &>/tmp/logfile.log this is it? –  newbie14 Jul 18 '12 at 17:21
    
I have checked /var/log/cron no error is just showing this Jul 19 01:06:08 itest CROND[2155]: (root) CMD (/home/test1/PF_RING-5.4.3/userland/examples/packetSecondAnalyis.c -m 2>&1 >> /var/log/myPacketeSecondAnalyis.log) Jul 19 01:06:08 itest CROND[2154]: (root) CMD (/home/test1/PF_RING-5.4.3/userland/examples/pfExeV3.c -m 2>&1 >> /var/log/myPacketCapture.log) Jul 19 01:06:08 itest CROND[2156]: (root) CMD (/home/test1/PF_RING-5.4.3/userland/examples/pAR.c -m 2>&1 >> /var/log/myPAR.log) Issue now is crond[2156] is not running. I have checked using top command also not there? –  newbie14 Jul 18 '12 at 17:30
    
@newbie14: see my edit –  Iain Jul 18 '12 at 17:41
    
Both gives me this /bin/sh: root: command not found. I have checked the file is own by root. –  newbie14 Jul 18 '12 at 17:54
    
@newbie14: If you're running the command from root's crontab then remove the root - I kind of assumed you were running it from /etc/crontab –  Iain Jul 18 '12 at 18:01

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.