1

I am using initlog tool in a cron file to write the output of ntpq -p command in syslog.. But initlog command has been deprecated in RHEL6.

Now, I want know the alternative of initlog command in RHEL6.

  • Maybe logger? – Bratchley Jul 14 '16 at 3:54
  • Can i write a command in logger? – ajay Jul 14 '16 at 4:09
  • You can pipe a command into logger and logger will treat each line of output as its own syslog message for however long the pipe remains open. – Bratchley Jul 14 '16 at 5:08
1

One possible solution from the comments is to use logger, possibly as such:

ntpq -p | logger

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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