2 deleted 43 characters in body
source | link

I want to grep this string 'FCE-Error' from a folder than contains loads of text based files

The folder looks like this

-rw-r--r-- 1 root root        0 May 22 10:30 T201805220930.CIR
-rw-r--r-- 1 root root 11298297 May 22 10:40 T201805220935.CDR
-rw-r--r-- 1 root root        0 May 22 10:35 T201805220935.CIR
-rw-r--r-- 1 root root 12230924 May 22 10:45 T201805220940.CDR
-rw-r--r-- 1 root root        0 May 22 10:40 T201805220940.CIR
-rw-r--r-- 1 root root 12707339 May 22 10:50 T201805220945.CDR
-rw-r--r-- 1 root root        0 May 22 10:45 T201805220945.CIR
-rw-r--r-- 1 root root 13080477 May 22 10:55 T201805220950.CDR
-rw-r--r-- 1 root root        0 May 22 10:50 T201805220950.CIR
-rw-r--r-- 1 root root 13762418 May 22 11:00 T201805220955.CDR
-rw-r--r-- 1 root root        0 May 22 10:55 T201805220955.CIR
-rw-r--r-- 1 root root 13582035 May 22 11:05 T201805221000.CDR
-rw-r--r-- 1 root root        0 May 22 11:00 T201805221000.CIR
-rw-r--r-- 1 root root 13910251 May 22 11:10 T201805221005.CDR
-rw-r--r-- 1 root root        0 May 22 11:05 T201805221005.CIR
-rw-r--r-- 1 root root  3360658 May 22 11:11 T201805221010.CDT
-rw-r--r-- 1 root root        0 May 22 11:10 T201805221010.CIT

It generates new files every 5 minutes CDT file = live running log file CDR file = is the previous CDT file before it generates a new one

I need a bash script which will either grep the .cdt or cdr file for this string FCE-Error

If it finds a positive value/entry then I need an alert on email

Can anybody help with this?

Thanks

I want to grep this string 'FCE-Error' from a folder than contains loads of text based files

The folder looks like this

-rw-r--r-- 1 root root        0 May 22 10:30 T201805220930.CIR
-rw-r--r-- 1 root root 11298297 May 22 10:40 T201805220935.CDR
-rw-r--r-- 1 root root        0 May 22 10:35 T201805220935.CIR
-rw-r--r-- 1 root root 12230924 May 22 10:45 T201805220940.CDR
-rw-r--r-- 1 root root        0 May 22 10:40 T201805220940.CIR
-rw-r--r-- 1 root root 12707339 May 22 10:50 T201805220945.CDR
-rw-r--r-- 1 root root        0 May 22 10:45 T201805220945.CIR
-rw-r--r-- 1 root root 13080477 May 22 10:55 T201805220950.CDR
-rw-r--r-- 1 root root        0 May 22 10:50 T201805220950.CIR
-rw-r--r-- 1 root root 13762418 May 22 11:00 T201805220955.CDR
-rw-r--r-- 1 root root        0 May 22 10:55 T201805220955.CIR
-rw-r--r-- 1 root root 13582035 May 22 11:05 T201805221000.CDR
-rw-r--r-- 1 root root        0 May 22 11:00 T201805221000.CIR
-rw-r--r-- 1 root root 13910251 May 22 11:10 T201805221005.CDR
-rw-r--r-- 1 root root        0 May 22 11:05 T201805221005.CIR
-rw-r--r-- 1 root root  3360658 May 22 11:11 T201805221010.CDT
-rw-r--r-- 1 root root        0 May 22 11:10 T201805221010.CIT

It generates new files every 5 minutes CDT file = live running log file CDR file = is the previous CDT file before it generates a new one

I need a bash script which will either grep the .cdt or cdr file for this string FCE-Error

If it finds a positive value/entry then I need an alert on email

Can anybody help with this?

Thanks

I want to grep this string 'FCE-Error' from a folder than contains loads of text based files

The folder looks like this

-rw-r--r-- 1 root root        0 May 22 10:30 T201805220930.CIR
-rw-r--r-- 1 root root 11298297 May 22 10:40 T201805220935.CDR
-rw-r--r-- 1 root root        0 May 22 10:35 T201805220935.CIR
-rw-r--r-- 1 root root 12230924 May 22 10:45 T201805220940.CDR
-rw-r--r-- 1 root root        0 May 22 10:40 T201805220940.CIR
-rw-r--r-- 1 root root 12707339 May 22 10:50 T201805220945.CDR
-rw-r--r-- 1 root root        0 May 22 10:45 T201805220945.CIR
-rw-r--r-- 1 root root 13080477 May 22 10:55 T201805220950.CDR
-rw-r--r-- 1 root root        0 May 22 10:50 T201805220950.CIR
-rw-r--r-- 1 root root 13762418 May 22 11:00 T201805220955.CDR
-rw-r--r-- 1 root root        0 May 22 10:55 T201805220955.CIR
-rw-r--r-- 1 root root 13582035 May 22 11:05 T201805221000.CDR
-rw-r--r-- 1 root root        0 May 22 11:00 T201805221000.CIR
-rw-r--r-- 1 root root 13910251 May 22 11:10 T201805221005.CDR
-rw-r--r-- 1 root root        0 May 22 11:05 T201805221005.CIR
-rw-r--r-- 1 root root  3360658 May 22 11:11 T201805221010.CDT
-rw-r--r-- 1 root root        0 May 22 11:10 T201805221010.CIT

It generates new files every 5 minutes CDT file = live running log file CDR file = is the previous CDT file before it generates a new one

I need a bash script which will either grep the .cdt or cdr file for this string FCE-Error

If it finds a positive value/entry then I need an alert on email

1
source | link

Grep latest file for string and alert / email if found

I want to grep this string 'FCE-Error' from a folder than contains loads of text based files

The folder looks like this

-rw-r--r-- 1 root root        0 May 22 10:30 T201805220930.CIR
-rw-r--r-- 1 root root 11298297 May 22 10:40 T201805220935.CDR
-rw-r--r-- 1 root root        0 May 22 10:35 T201805220935.CIR
-rw-r--r-- 1 root root 12230924 May 22 10:45 T201805220940.CDR
-rw-r--r-- 1 root root        0 May 22 10:40 T201805220940.CIR
-rw-r--r-- 1 root root 12707339 May 22 10:50 T201805220945.CDR
-rw-r--r-- 1 root root        0 May 22 10:45 T201805220945.CIR
-rw-r--r-- 1 root root 13080477 May 22 10:55 T201805220950.CDR
-rw-r--r-- 1 root root        0 May 22 10:50 T201805220950.CIR
-rw-r--r-- 1 root root 13762418 May 22 11:00 T201805220955.CDR
-rw-r--r-- 1 root root        0 May 22 10:55 T201805220955.CIR
-rw-r--r-- 1 root root 13582035 May 22 11:05 T201805221000.CDR
-rw-r--r-- 1 root root        0 May 22 11:00 T201805221000.CIR
-rw-r--r-- 1 root root 13910251 May 22 11:10 T201805221005.CDR
-rw-r--r-- 1 root root        0 May 22 11:05 T201805221005.CIR
-rw-r--r-- 1 root root  3360658 May 22 11:11 T201805221010.CDT
-rw-r--r-- 1 root root        0 May 22 11:10 T201805221010.CIT

It generates new files every 5 minutes CDT file = live running log file CDR file = is the previous CDT file before it generates a new one

I need a bash script which will either grep the .cdt or cdr file for this string FCE-Error

If it finds a positive value/entry then I need an alert on email

Can anybody help with this?

Thanks