Skip to content

Instantly share code, notes, and snippets.

@jhrcz
Last active August 29, 2015 13:55
Show Gist options
  • Save jhrcz/8729840 to your computer and use it in GitHub Desktop.
Save jhrcz/8729840 to your computer and use it in GitHub Desktop.
grep in all cron tasks

sample cmd:

header () { echo "#" ; echo "#" ; echo "# $1" ; echo "#" ; echo "#" ; }  ; ( header "/etc/crontab" ; grep -H . /etc/crontab ; header "system cron scripts cron.d, daily,... " ; grep -H . /etc/cron.*/* ; header "users" ; grep -H . /var/spool/cron/* ) | grep httpd

output:

/etc/cron.d/apache-la2:30 23   * * *     root   test -d /var/log/httpd && chmod o+rx /var/log/httpd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment