Thursday, April 17, 2014

Script Not Executing In Crontab - SOLVED!

I was trying to run the following command in a script, which needed to be output to a text file:

chkconfig --list | grep on | sed s/[0-9]:off//g | grep [0-9]:on >> $txt

The output did not list any of the jobs configured to run on startup, just blank output. I corrected this by changing the command as follows:

/sbin/chkconfig --list | grep on | sed s/[0-9]:off//g | grep [0-9]:on >> $txt

This immediately fixed the problem.

Courtesy of:

No comments:

Post a Comment