Skip to content

Instantly share code, notes, and snippets.

@bglopez
Forked from thydel/ln-log.mk
Created March 15, 2022 14:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bglopez/8bbdcd73388d1c98e6ebc3606de48a51 to your computer and use it in GitHub Desktop.
Save bglopez/8bbdcd73388d1c98e6ebc3606de48a51 to your computer and use it in GitHub Desktop.
Link log from deep to flat
top:; @date
log := find /space/log -name '*.log'
base := cut -d/ -f4-
apache-links := sed -e 's;\(.*\)/\(.*\);ln -f /space/log/\1/\2 /space/log2/\1_\2;'
php-links := sed -e 's;\(.*\)/php/\(.*\);ln -f /space/log/\1/\2 /space/log2/\1_php_\2;'
apache := $(log) | grep -v /php/ | $(base) | $(apache-links)
php := $(log) | grep /php/ | $(base) | $(php-links)
apache php:; $($@)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment