Haii all


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Haii all
# 1  
Old 08-20-2010
Bug Haii all

I want to write a script to check files update in system time.

actually i have a folder called "backup" in that files will be created for every some mintues. i want to check weather the files are creating in current time or not.
if the files are updating then i want to print "update OK"
if not " update not OK"

ex: i have files like this.
Code:
-r--r--r--   1 lscpusr  lscpusr  10000074 Aug 20 01:14 SCP_20_08_2010_00_38_05.log
-r--r--r--   1 lscpusr  lscpusr  10000246 Aug 20 02:11 SCP_20_08_2010_01_14_35.log
-r--r--r--   1 lscpusr  lscpusr  10000091 Aug 20 03:32 SCP_20_08_2010_02_11_16.log
-r--r--r--   1 lscpusr  lscpusr  10000068 Aug 20 04:55 SCP_20_08_2010_03_32_08.log
-r--r--r--   1 lscpusr  lscpusr  10000123 Aug 20 06:20 SCP_20_08_2010_04_55_14.log
-r--r--r--   1 lscpusr  lscpusr  10000072 Aug 20 07:08 SCP_20_08_2010_06_20_45.log
-r--r--r--   1 lscpusr  lscpusr  10000055 Aug 20 07:41 SCP_20_08_2010_07_08_14.log
-r--r--r--   1 lscpusr  lscpusr  6947408 Aug 20 07:59 SCP_20_08_2010_07_41_27.log


i want to print OK if files are updating current time or last 5 mins.

pls help me !!!

Thanks in advance.

Last edited by DukeNuke2; 08-20-2010 at 04:35 AM..
# 2  
Old 08-20-2010
Quote:
Originally Posted by steve2216
I want to write a script to check files update in system time.

actually i have a folder called "backup" in that files will be created for every some mintues. i want to check weather the files are creating in current time or not.
if the files are updating then i want to print "update OK"
if not " update not OK"

ex: i have files like this.
Code:
-r--r--r--   1 lscpusr  lscpusr  10000074 Aug 20 01:14 SCP_20_08_2010_00_38_05.log
-r--r--r--   1 lscpusr  lscpusr  10000246 Aug 20 02:11 SCP_20_08_2010_01_14_35.log
-r--r--r--   1 lscpusr  lscpusr  10000091 Aug 20 03:32 SCP_20_08_2010_02_11_16.log
-r--r--r--   1 lscpusr  lscpusr  10000068 Aug 20 04:55 SCP_20_08_2010_03_32_08.log
-r--r--r--   1 lscpusr  lscpusr  10000123 Aug 20 06:20 SCP_20_08_2010_04_55_14.log
-r--r--r--   1 lscpusr  lscpusr  10000072 Aug 20 07:08 SCP_20_08_2010_06_20_45.log
-r--r--r--   1 lscpusr  lscpusr  10000055 Aug 20 07:41 SCP_20_08_2010_07_08_14.log
-r--r--r--   1 lscpusr  lscpusr  6947408 Aug 20 07:59 SCP_20_08_2010_07_41_27.log

i want to print OK if files are updating current time or last 5 mins.

pls help me !!!

Thanks in advance.
Are you using a cron file to create these files?
# 3  
Old 08-20-2010
files update process check

Hi cola,

Yeah . i'm using cron to run the logger files.

but i want to put a separate file to check the file updation.
and print OK or NOT OK.
Login or Register to Ask a Question

Previous Thread | Next Thread
Login or Register to Ask a Question