Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Hi,
The problem that I am facing is as below:
There is a shell script which take 2 dates as input (today's date and yesterday's date) and when I am running the below command on Unix prompt, it is running fine.The command is
$SIEBEL_ROOT/eim/EIM_Asset_Inactivate/call_Update_AssetStatus.sh "`TZ="GMT+24" date +'%d/%m/%Y'`" "`date '+%d/%m/%Y'`"
But when I am giving the same command in cron job, it is running but it is not taking the input dates.
Cron job entry is
0 5 * * * $SIEBEL_ROOT/eim/EIM_Asset_Inactivate/call_Update_AssetStatus.sh "`TZ="GMT+24" date +'%d/%m/%Y'`" "`date '+%d/%m/%Y'`"
Could you please help me in resolving this issue.

Typically, when a script runs from the command line, it's because the cron environment is different from the environment where the script was developed.
First, are you sure that the cron environment knows about this environmental var: $SIEBEL_ROOT
Second, I would make sure the call_Update_AssetStatus.sh script has a shell envocation on line 1: #!/bin/ksh or #!/bin/sh
Every non-linix cron I have worked with assumes #!/bin/sh.I would also make sure that call_Update_AssetStatus.sh sets its own environmenatl variables such as PATH.
Does the script assume you have to be in a certain directory that the cron enviironment will not know about? That could trip you up.

Previously it was not working, later I have changed the environment variable with actual path.
Now the current cron tab entry is0 5 * * * /siebel/vlmPRD/siebsrvr/eim/EIM_Asset_Inactivate/call_Update_AssetStatus.sh "`TZ="GMT+24" date +'%d/%m/%Y'`" "`date '+%d/%m/%Y'`"
Now file is executing but the problem is that the 2 input arguments that I am passing is not getting converted to dates i.e. "`TZ="GMT+24" date +'%d/%m/%Y'`" "`date '+%d/%m/%Y'`"
these 2 input arguments are yesterday's date and current date.
Please let me know how it will work.

![]() |
![]() |
![]() |
| Login or Register to Reply | |
| Login | Register |
| Ads by Google |