Skip to content
Browse files

Fix get.sh to work on 10.8

  • Loading branch information...
1 parent ff7515d commit f972707b01183163994c3aa72b974e4505691968 @andreyvit andreyvit committed Dec 17, 2012
Showing with 7 additions and 2 deletions.
  1. +7 −2 get.sh
View
9 get.sh
@@ -1,4 +1,9 @@
#!/bin/bash
+
+newer_than() {
+ ! /bin/test -f "$2" || /bin/test "$1" -nt "$2"
+}
+
mkdir -p data/apache-bz2
mkdir -p data/apache
echo "RSYNC data/apache-bz2"
@@ -7,14 +12,14 @@ cd data/apache
for i in ../apache-bz2/*.bz2; do
dst="$(basename "$i" .bz2)"
- if /usr/bin/test "$i" -nt "$dst"; then
+ if newer_than "$i" "$dst"; then
echo BUNZIP $(basename "$i")
bunzip2 -c $i >"$dst"
fi
done
for i in access_log.*[abcdef]; do
marker="$i.DONEZ"
- if /usr/bin/test "$i" -nt "$marker"; then
+ if newer_than "$i" "$marker"; then
echo "CONCAT $i"
cat $i >>${i%?}
touch $marker

0 comments on commit f972707

Please sign in to comment.
Something went wrong with that request. Please try again.