Searching file contents for values different to a set value

Get help. Get answers. Let others lend you a hand.

Moderator: Mr_Noodle

Hi,

I'm trying to use Hazel to assess if a backup job has succeeded by examine the log file.

To do this I need to determine if ANY of the following is true

1. Number of skipped files > 0
2. Number of mismatched files > 0
3. Number of failed files > 0
4. Ended date <> yesterdays date

A sample input is
**************************************
Total Copied Skipped Mismatch FAILED Extras
Dirs : 10266 0 0 0 0 0
Files : 200825 2 200823 0 0 0
Bytes : 79.224 g 239.8 k 79.224 g 0 0 0
Times : 0:16:03 0:00:00 0:00:00 0:16:02


Speed : 314033 Bytes/sec.
Speed : 17.969 MegaBytes/min.
Ended : 12 August 2017 17:48:03
*****************************************

Any idea if this can be achieved and if so any pointers would be most gratefully received

Dek
dekyras
 
Posts: 1
Joined: Thu Aug 17, 2017 9:46 am

You'll need to write a script to parse that file. There are tons of different approaches for this but the quickest way might be using the "grep" command in a shellscript. I'd search around on how to use grep as well as shell scripting if you aren't familiar with it.
Mr_Noodle
Site Admin
 
Posts: 11872
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support