dannyfang 0 Newbie Poster

Hi,

I have a script which is to perform the following task:
1) check for files in a particular directory.

2) The directory should contain 4 files in the form of:
<OSSInstance>_<OSSName>_BSC<Nokia BSC ID>.<counter no>.<YYYYMMDDHHMM>.<gid>

whereby:
OSSInstance - a combination of alphanumeric characters
OSSName -a combination of alphanumeric characters
Nokia BSC ID - a combination of alphanumeric characters
counter no - Digits 1,2, 3 and 72 only
YYYYMMDDHHMM - basically a numeric value denoting timestamp of the file i.e. 200603130500
gid - a numeric value for a particular process

An example of the file is shown below as:
1003_oxnn2_BSC48379.72.200603130500.768751

3)There is a timeout period in the script which checks if these 4 files are available within the particular directory.These 4 files are being transferred remotely from some machine.

4)If ALL 4 files are already in the directory within the specified timeout period, then it's copied to another directory where it's tar-ed and gzip-ed.

5)If one(1) of the 4 files are not the directory within the specified timeout period, these files are copied elsewhere and their names written into a log file.

6) The timeout period in waiting for ALL 4 files to arrive is 5 mins.

However I've encountered some problems within the script, which is captured below:
prod-cingtuna\ :/mkl/users/lows >./Nokia_RAN-tarNew.sh
1003_oxnn2_BSC48379.1.200603130500.768741: dskjfhkdjs: not found
1003_oxnn2_BSC48379.1.200603130500.768741: djkdahlk: not found
1003_oxnn2_BSC48379.1.200603130500.768741: anjhsahdklsad: not found
1003_oxnn2_BSC48379.1.200603130500.768741: askjdhasas^Jdaskj^Jakjchdajk^J: not found
OSS_INSTANCE
1003_oxnn2_BSC48379.1.200603130500.768741: dskjfhkdjs: not found
1003_oxnn2_BSC48379.1.200603130500.768741: djkdahlk: not found
1003_oxnn2_BSC48379.1.200603130500.768741: anjhsahdklsad: not found
1003_oxnn2_BSC48379.1.200603130500.768741: askjdhasas^Jdaskj^Jakjchdajk^J: not found
OSS_NAME
1003_oxnn2_BSC48379.1.200603130500.768741: dskjfhkdjs: not found
1003_oxnn2_BSC48379.1.200603130500.768741: djkdahlk: not found
1003_oxnn2_BSC48379.1.200603130500.768741: anjhsahdklsad: not found
1003_oxnn2_BSC48379.1.200603130500.768741: askjdhasas^Jdaskj^Jakjchdajk^J: not found
TMP_VAR
BSC_VAL
NOKIA_BSC_ID
TIMESTAMP
GRP_DAY 20
hrmin 17:50
GRP_HOUR 17
GRP_MIN 50
NUM_FILES 1
1003_oxnn2_BSC48379.2.200603130500.768750: dskjfhkdjs: not found
1003_oxnn2_BSC48379.2.200603130500.768750: djkdahlk: not found
1003_oxnn2_BSC48379.2.200603130500.768750: anjhsahdklsad: not found
1003_oxnn2_BSC48379.2.200603130500.768750: askjdhasas^Jdaskj^Jakjchdajk^J: not found
OSS_INSTANCE
1003_oxnn2_BSC48379.2.200603130500.768750: dskjfhkdjs: not found
1003_oxnn2_BSC48379.2.200603130500.768750: djkdahlk: not found
1003_oxnn2_BSC48379.2.200603130500.768750: anjhsahdklsad: not found
1003_oxnn2_BSC48379.2.200603130500.768750: askjdhasas^Jdaskj^Jakjchdajk^J: not found
OSS_NAME
1003_oxnn2_BSC48379.2.200603130500.768750: dskjfhkdjs: not found
1003_oxnn2_BSC48379.2.200603130500.768750: djkdahlk: not found
1003_oxnn2_BSC48379.2.200603130500.768750: anjhsahdklsad: not found
1003_oxnn2_BSC48379.2.200603130500.768750: askjdhasas^Jdaskj^Jakjchdajk^J: not found
TMP_VAR
BSC_VAL
NOKIA_BSC_ID
TIMESTAMP
GRP_DAY 20
hrmin 17:50
GRP_HOUR 17
GRP_MIN 50
NUM_FILES 2
1003_oxnn2_BSC48379.3.200603140500.768751: dskjfhkdjs: not found
1003_oxnn2_BSC48379.3.200603140500.768751: djkdahlk: not found
1003_oxnn2_BSC48379.3.200603140500.768751: anjhsahdklsad: not found
1003_oxnn2_BSC48379.3.200603140500.768751: askjdhasas^Jdaskj^Jakjchdajk^J: not found
OSS_INSTANCE
1003_oxnn2_BSC48379.3.200603140500.768751: dskjfhkdjs: not found
1003_oxnn2_BSC48379.3.200603140500.768751: djkdahlk: not found
1003_oxnn2_BSC48379.3.200603140500.768751: anjhsahdklsad: not found
1003_oxnn2_BSC48379.3.200603140500.768751: askjdhasas^Jdaskj^Jakjchdajk^J: not found
OSS_NAME
1003_oxnn2_BSC48379.3.200603140500.768751: dskjfhkdjs: not found
1003_oxnn2_BSC48379.3.200603140500.768751: djkdahlk: not found
1003_oxnn2_BSC48379.3.200603140500.768751: anjhsahdklsad: not found
1003_oxnn2_BSC48379.3.200603140500.768751: askjdhasas^Jdaskj^Jakjchdajk^J: not found
TMP_VAR
BSC_VAL
NOKIA_BSC_ID
TIMESTAMP
GRP_DAY 20
hrmin 17:50
GRP_HOUR 17
GRP_MIN 50
NUM_FILES 3
1003_oxnn2_BSC48379.72.200603130500.768751: dskjfhkdjs: not found
1003_oxnn2_BSC48379.72.200603130500.768751: djkdahlk: not found
1003_oxnn2_BSC48379.72.200603130500.768751: anjhsahdklsad: not found
1003_oxnn2_BSC48379.72.200603130500.768751: askjdhasas^Jdaskj^Jakjchdajk^J: not found
OSS_INSTANCE
1003_oxnn2_BSC48379.72.200603130500.768751: dskjfhkdjs: not found
1003_oxnn2_BSC48379.72.200603130500.768751: djkdahlk: not found
1003_oxnn2_BSC48379.72.200603130500.768751: anjhsahdklsad: not found
1003_oxnn2_BSC48379.72.200603130500.768751: askjdhasas^Jdaskj^Jakjchdajk^J: not found
OSS_NAME
1003_oxnn2_BSC48379.72.200603130500.768751: dskjfhkdjs: not found
1003_oxnn2_BSC48379.72.200603130500.768751: djkdahlk: not found
1003_oxnn2_BSC48379.72.200603130500.768751: anjhsahdklsad: not found
1003_oxnn2_BSC48379.72.200603130500.768751: askjdhasas^Jdaskj^Jakjchdajk^J: not found
TMP_VAR
BSC_VAL
NOKIA_BSC_ID
TIMESTAMP
GRP_DAY 20
hrmin 17:50
GRP_HOUR 17
GRP_MIN 50
NUM_FILES 4
a /tmp/osspkg2s/uma/umabass/cs_bsspm_aif/client/out/1003_oxnn2_BSC48379.1.200603130500.768741 1K
a /tmp/osspkg2s/uma/umabass/cs_bsspm_aif/client/out/1003_oxnn2_BSC48379.2.200603130500.768750 1K
a /tmp/osspkg2s/uma/umabass/cs_bsspm_aif/client/out/1003_oxnn2_BSC48379.3.200603140500.768751 1K
a /tmp/osspkg2s/uma/umabass/cs_bsspm_aif/client/out/1003_oxnn2_BSC48379.72.200603130500.768751 1K
prod-cingtuna\ :/mkl/users/lows >

From the script output above:
1) I'm not sure why it is producing the error"1003_oxnn2_BSC48379.1.200603130500.768741: dskjfhkdjs: not found"
The file contents are:
prod-cingtuna\ :/mkl/users/lows >cat 1003_oxnn2_BSC48379.1.200603130500.768741
dskjfhkdjs
djkdahlk
anjhsahdklsad
askjdhasas'
daskj
akjchdajk

2) It seems that for every line in the file, the script outputs the "not found" error to the standard output - I'm not able to see where it's coming from witin the script.

3) Some of the values for the variables shown below within the script are not having any values inspite being assigned values from AWK:
TMP_VAR
BSC_VAL
NOKIA_BSC_ID
TIMESTAMP
The AWK statement has been tested on the command line and it's producing correct

4)Once all 4 files are in the specified directory, they all do get copied to another directory (specified as /tmp/osspkg2s/uma/umabass/cs_bsspm_aif/client/out in the script)
However, tar and gzip process failed to tar these 4 files correctly(according to the name specified in the directory) into a single file and zip them.
Instead, the file ._.._.BSC.BSC_VAL..tar.gz
is produced:
prod-cingtuna\ :/mkl/users/lows >ls -la
total 112
-rw-r--r-- 1 lows metrica 322 Mar 20 19:44 ._.._.BSC.BSC_VAL..tar.gz

Could anyone help me out by pointing out where did I go wrong in the script?

Feel free to modify the script.

Thanks in advance.
Danny