![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| cronjob inside the script | namishtiwari | Shell Programming and Scripting | 3 | 02-04-2008 05:35 AM |
| Nested loop not running using cronjob | bihani4u | Shell Programming and Scripting | 9 | 09-26-2007 08:19 AM |
| help help cronjob problem with script | bucci | Shell Programming and Scripting | 4 | 02-10-2007 01:38 AM |
| Shell script not running thru Cronjob | gauravshrinivas | Shell Programming and Scripting | 8 | 11-03-2006 07:17 AM |
| Environment variables causing cronjob to fail | new2ss | Shell Programming and Scripting | 2 | 05-31-2006 08:58 PM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
||||
|
||||
|
Variables are not getting exported while running the script in cronjob
Hi All
Some how, variables are not getting exported while running the script in cronjob. Variable value is coming blank. But the variables are geting the value when the same script I am running manually. Any idea why? When running the script in cron-job ================================== user@server:~$ crontab -l 00 22 * * * $HOME/crt-offline-chkpnt.sh When running the script manually ================================== user@server:~$ ./crt-offline-chkpnt.sh Thanks a lot to all in advance C Saha |
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
actually the file and the o/p is like this
$ cat crt-offline-chkpnt.sh P4_COUNTER=`p4 -u cm -P cmpswd counters | grep journal | awk '{print $3}'` echo "$P4_COUNTER" >aa.log $ ./crt-offline-chkpnt.sh $ cat aa.log 1157 No output when I have it in cronjob :-( Last edited by csaha; 02-20-2006 at 03:21 AM. |
|
#3
|
|||
|
|||
|
Hi,
have you checked the aa.log file, whats going in it and post your cron entry as well Gaurav |
|
#4
|
||||
|
||||
|
SORRY for the typo error in my previous post.
Yes I saw aa.log, its coming blank when its running by cronjob This is cron settings When running the script in cron-job ================================== user@server:~$ crontab -l 00 22 * * * $HOME/crt-offline-chkpnt.sh |
|
#5
|
|||
|
|||
|
you may want to consider using explicit paths instead of paths with variables in them. quite honestly, i've never seen variables used in a cron table before.
if anything, you may want to check to see if: 1. your script is running at all (check your local mailbox for cron errors( and 2. put in the full path to your 'p4' command. |
|
#6
|
|||
|
|||
|
Also try including your profile in the script your are calling via cron
|
|
#7
|
||||
|
||||
|
Yes exactly. Both of your suggession worked. Its fine now.
|
||||
| Google The UNIX and Linux Forums |