If this is your first visit, be sure to check out the FAQ by clicking the link above.
You may have to register before you can post: click the register link above to proceed.
To start viewing messages, select the forum that you want to visit from the selection below.
I am trying to run db2diag -A filename to archive
db2diag.log in /db2/SID/db2dump folder. It works fine from command
line, but does not work in crontab. I made a script that the crontab will
call. I get a db2 command not found error. I read on forum to add
-readfile option. I need help where to add this option.
My command in the script is
db2diag -A /backup/dump_xxx
this works fine from the command but not in the script, where should I add
the -readfile option.
Thanks a lot for the help.
The reason you are getting the command not found error is because your DB2 environment is not set up properly through cron. By loading the profile as the fist line, like we have suggested, this will fix the problem.
Thanks Marcus - you're absolutely right about the solution. If you're trying to use
db2diag in a script that crontab invokes, use the -readfile parameter. I can't tell you how many variations of running sqllib/db2profile and other things within the script I've tried, but -readfile worked right away.