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
  • Save bglopez/8bbdcd73388d1c98e6ebc3606de48a51 to your computer and use it in GitHub Desktop.
Save bglopez/8bbdcd73388d1c98e6ebc3606de48a51 to your computer and use it in GitHub Desktop.

Revisions

  1. @thydel thydel revised this gist Jan 23, 2017. No changes.
  2. @thydel thydel created this gist Nov 24, 2016.
    12 changes: 12 additions & 0 deletions ln-log.mk
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,12 @@
    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:; $($@)