Cron variables

July 25, 2011 at 06:06:50
Specs: Unix
I am very new to Unix and Cron. One of my script is scheduled in cron as below.

45 05 * * 0-4 ksh /u/abc/bin/ user password database >> /u/abc/log/script_database.LOG 2>&1

In the above line, the "user", "password" and "database" values are hard-coded. I was asked to remove those hard-codings and wondering how to do that..

I am not even sure if these hard-coded values are the parameters passing to the shell script or if they are used by cron to connect to the db. I can confirm that, inside the shell script, there is code to setup env and connect to the db using id and password. I mean external parameters are NOT required to the script.

Could anyone please help me to remove the hard-codings from the cron....

See More: Cron variables

Report •

July 25, 2011 at 07:03:28
I can tell you definitely that the 3 arguments belong to the script; cron does not require them.

I suggest you run some tests from the command line.

From the command line, execute without the arguments you think are not required, and see what happens.

If it works from the command line, it will work from cron.

Report •
Related Solutions

Ask Question