I created script to check the files in the folder for 4 hours ago it is working fine because I am using HP UX.
fourago=`date +"%m %d %H %M" | awk '{ fourago=$3 - 4 ; if ((fourago<4)&&(fourago>3)) { fourago=59 } printf("%.2d%.2d%.2d%.2d\n",$1,$2,fourago,$4) }'`
To check 16 hours ago can I use this like below
sixteenhourago=`date +"%m %d %H %M" | awk '{ sixteenhourago=$3 - 16 ; if ((sixteenhourago<16)&&(sixteenhourago>3)) { fourhourago=59 } printf("%.2d%.2d%.2d%.2d\n",$1,$2,fourhourago,$16) }'`
I created above command based on below logic Not sure it is correct or not Please help on this. $3 (current Hour) -1, or one hour ago. To make it 16 hours ago we need to use -16.
some files might be 3 hours 59 minutes ago those should still be counted.