Skip to content

Instantly share code, notes, and snippets.

@thydel
Last active March 15, 2022 14:01
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save thydel/e0a8e54ba485defd51ff109a858dfc95 to your computer and use it in GitHub Desktop.
Save thydel/e0a8e54ba485defd51ff109a858dfc95 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