![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | 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 and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Writing to standard error | padmisri | Shell Programming and Scripting | 2 | 07-23-2009 05:28 AM |
| Run perl file in Crontab error. | raccsdl | Shell Programming and Scripting | 2 | 11-13-2007 07:07 AM |
| Crontab error Cannot execute binary file. | raccsdl | Shell Programming and Scripting | 5 | 11-13-2007 06:22 AM |
| failure writing network systems-ftp error | DILEEP410 | UNIX for Dummies Questions & Answers | 0 | 04-26-2007 11:03 AM |
| Writing to Standard Error | sjung10 | UNIX for Dummies Questions & Answers | 1 | 11-10-2006 12:16 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
error in file writing in crontab
Hi ,
I have a crontab job that is trying to write a file and the read it . But the crontab is not able to create any file . But when i run the script as shell then it runs fine . could you tell me what i am missing here . Here is the script cat Tablespace_Monitor_ATG #!/bin/ksh PATH=/usr/bin::/jcw-data/home/jcwprodi/sqllib/bin:/jcw-data/home/jcwprodi/sqllib/adm:/jcw-data/home/jcwprodi/sqllib/misc:/bin DB2INSTANCE=jcwprodi LD_LIBRARY_PATH=:/usr/lib:/usr/sbin:/usr/bin:/lib export PATH DB2INSTANCE db2 -x "connect to atg " db2 -x "drop table daya.tablespace_info " db2 -x "create table daya.tablespace_info ( Tblsp_name varchar(15) , size_in_mb bigint ,Per_free_space int, used_size_mb bigint )" db2 -x "select tablespace_name , int((total_pages*page_size)/(1024*1024)) as Size_in_MB ,smallint((float(free_pages) / float(total_pages))*100) as per_free_space, int((used_pages*page_size)/(1024*1024)) as Used_size_MB from table(SNAPSHOT_TBS_CFG('ATG',-1)) where tablespace_type=0 " db2 -x "insert into daya.tablespace_info select tablespace_name , int((total_pages*page_size)/(1024*1024)) as Size_in_MB ,smallint((float(free_pages) / float(total_pages))*100) as per_free_space, int((used_pages*page_size)/(1024*1024)) as Used_size_MB from table(SNAPSHOT_TBS_CFG('ATG',-1)) where tablespace_type=0 " echo "TABLESPACE NAME % FREE SPACE" > Tablespace_info_atg echo " " >> Tablespace_info_atg db2 -x "select TBLSP_NAME as Name ,PER_FREE_SPACE as Percentage_use from daya.tablespace_info" > Tablespace_info_atg # It is failing to create the above file Tablespace_info_atg chmod 777 Tablespace_info_atg cat /jcw-data/jcwprodi/CRONTAB/Tablespace_info_atg | mail -s "Tablespace Usage For ATG on WAG-PROD-DBCLUSTER " abc_123@yahoo.com Thanks in advance |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|