Re: Crontab oncheck script
Posted in 1997
Donald S. Bryant wrote:
> Recently I've been trying to run a script from the crontab which makes
> several different calls to oncheck and onstat. Unfortunately this
> results in an Informix error
> indicating that when this script is run from the crontab that
> insufficient priviledges exist. The same script when executed by root
> from the command line works fine.
>
> Does anyone have a clue why this is failing?
We have no clues because you gave us insufficient info.
Who ran the crontab command to create the cron entry in
/var/spool/cron/crontabs? (OK, on your system it may be in a different
directory.) If it was any ordinary user, say Donald, that user may not
have all the necessary database/table/column privileges needed to
perform all the commands. By Informix convention, user root is accorded
all privileges of DBA and informix. I will will not argue the demerits
of this convention here but that's why it works when you run it as root
from the command line. If you run it as donald, it would probably fail.
Recommendation: Log in as the DBA of the database and create the crontab
entry that way. This will create the file /var/spool/cron/crontabs/dba
and will run with all the necessary privileges.
Safer idea: Give user Donald all the necessary privs to run the script
and let 'er rip as user donald.
Good luck!
--
-- Jake (Never yelled "CROWDED THEATER!" during a fire)
+------------------------------------------------------------+
| The expedient performance of a task with excessive concern |
| regarding its duration-to-completion engenders a virtual |
| certainty of diminished benefit therefrom. |
| -- Benjamin Franklin (but he said it in 3 words) |
+------------------------------------------------------------+