1 |
6969
|
aaronmk
|
#!/bin/sh
|
2 |
|
|
# Gets the date of an import based on its log files' mtimes
|
3 |
6971
|
aaronmk
|
# Note that this is the time the first special input *finished* importing.
|
4 |
|
|
# The import itself generally starts a few minutes before that, and the exact
|
5 |
|
|
# time is in that import's public schema comment.
|
6 |
6974
|
aaronmk
|
# Note that Mac and Linux differ in the order they sort the logs in.
|
7 |
6969
|
aaronmk
|
|
8 |
|
|
selfDir="$(dirname -- "$0")"
|
9 |
|
|
|
10 |
|
|
if ! test "$#" -ge 1; then
|
11 |
|
|
echo "Usage: self logs..."|fold -s >&2
|
12 |
|
|
exit 2
|
13 |
|
|
fi
|
14 |
|
|
|
15 |
|
|
for log in "$@"; do
|
16 |
|
|
"$selfDir/mtime" "$log"
|
17 |
|
|
break # only for first log file
|
18 |
|
|
done
|