Project

General

Profile

« Previous | Next » 

Revision 790

input.Makefile: Log each import to a new log file named according to the current time

View differences:

inputs/input.Makefile
15 15
+_ = $(+:_%=)
16 16
addBeforeExt = $(basename $(2))$(1)$(suffix $(2))
17 17

  
18
# System
19
date = $(shell date +"%Y-%m-%d-%H-%M-%S")
20

  
18 21
# Terminal
19 22
esc := '['
20 23
reset := $(esc)'0m'
......
103 106

  
104 107
import: _always import-all verify ;
105 108

  
106
log = $(@:-all=)$(if $(n),.n=$(n),).log
109
log = $(@:-all=)$(if $(n),.n=$(n),).$(date).log
107 110
import = -(set -x; "time" env commit=1 $(map2db)) \
108 111
$(if $(n),,>>$(log)) 2>&1$(if $(n),|tee -a $(log))
109 112
# ignore import errors, which are often benign (e.g. invalid date format)
......
124 127
import: _always ;
125 128
endif
126 129

  
130
##### Log files from import
131

  
127 132
logs := $(wildcard *.log)
128 133

  
129 134
rm_logs: _always

Also available in: Unified diff