WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: stumped on preventing crond terminal message  (Read 3768 times)

Offline bigpcman

  • Hero Member
  • *****
  • Posts: 719
stumped on preventing crond terminal message
« on: February 12, 2009, 01:35:59 PM »
I have a crond job running that I created with crontab -e which works fine.
cron job
Code: [Select]
*/15 * * * *  /mnt/sda1/myscript > /dev/null 2>&1
However, when I exit out of x to the tc command prompt (or bootup using "text") I see that every time crond executes the cron job it outputs a message to the terminal and then "hangs" requiring a cnt c to regain the terminal prompt.
Message
Code: [Select]
crond [5817]: USER root pid 6130 cmd  /mnt/sda1/myscript > /dev/null 2>&1
How do I correct this behavior?
big pc man

Offline Kingdomcome

  • Sr. Member
  • ****
  • Posts: 286
Re: stumped on preventing crond terminal message
« Reply #1 on: February 12, 2009, 02:47:12 PM »
you can edit the wrapper /etc/init.d/crond and add -L /dir/to/cron.log or -L /dev/null to the OPTIONS variable

Offline bigpcman

  • Hero Member
  • *****
  • Posts: 719
Re: stumped on preventing crond terminal message
« Reply #2 on: February 12, 2009, 03:25:49 PM »
you can edit the wrapper /etc/init.d/crond and add -L /dir/to/cron.log or -L /dev/null to the OPTIONS variable

Oh the "-L" option! I was starting crond in bootlocal.sh using crond > /dev/null 2>&1. I didn't know about -L so now when I use,
"crond -L /dev/null 2>&1" everthing works as it should. Thanks for the help.
big pc man

Offline hliauw

  • Newbie
  • *
  • Posts: 1
Re: stumped on preventing crond terminal message
« Reply #3 on: April 23, 2010, 03:45:31 PM »
you can edit the wrapper /etc/init.d/crond and add -L /dir/to/cron.log or -L /dev/null to the OPTIONS variable


I tried this, but after reboot, the file reverted back to the original file with OPTIONS="-b". Does this file get a fresh copy on every boot?

Offline maro

  • Hero Member
  • *****
  • Posts: 1228
Re: stumped on preventing crond terminal message
« Reply #4 on: April 23, 2010, 06:04:55 PM »
@hliauw: What kind of persistence do you use? The file in question (i.e. '/etc/init.d/crond') is by default not included in any backup.

So to include the changed file into the backup you'll need to add etc/init.d/crond to '/opt/.filetool.lst' (please note the lack of a leading forward slash). Afterwards you need to ensure that a backup is performed, and you should expect that the files gets restored as part of your reboot.

Offline moB

  • Newbie
  • *
  • Posts: 49
Re: stumped on preventing crond terminal message
« Reply #5 on: April 07, 2011, 06:10:47 AM »
you can edit the wrapper /etc/init.d/crond and add -L /dir/to/cron.log or -L /dev/null to the OPTIONS variable
"crond -L /dev/null 2>&1"
Kingdomcome, bigpcman,
 
Thanks for this!

moB

 I learned about free software as a way of life by joining a community of programmers who already lived it.
--rms