This should work <!-- language: lang-sh --> if find /var/log/crashes -name 'app-\*\.log' -mmin -5 | grep -q . then service myapp restart fi