awk '/backupd/{print NR}' /var/log/system.log
Count Log Entries for a Pattern
You see a lot of entries for various things in log files. Here, we’re going to print out the number of entries with backupd in them:

grep -c also works here