I want to find the size of particular file exists in a particular directory
and i wnt to zip it.
In the below mentioned code it should check the MQ.log in the
particular directory.Please correct my code so that it will check
for particular MQ.log but i could not able to check whether
the MQ.log exist and please tell me the way to check the file size also
the code works fine but i still get some bugs.......
Its printing the loop1 and MQ.log but when it goes to checking
the file size it throws error...... "ls: MQ.log: No such file or directory" .........
and also in the braces which suppose to check the file size greater than
zero
Inside the script
FILESIZE=`ls -l $i|awk '{print $5}'`
"ls: MQ.log: No such file or directory" <<<error message
please tell me how to solve this
--------------------------------------
Loop1
MQ.log
ls: MQ.log: No such file or directory
test4.sh: line 21: [: -ge: unary operator expected
-------------------------------------------
In case the script is executed from the different directory,then "$i" will expand to MQ.log and not the full path to it,so it throws an error.Either you can try running the script from the directory (ROTATE_PATH) or give the full path