[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [check/master] Only download descriptor files from the last hour and a half.



commit 8ff3537fe11a46caa06e59c2a50cd9a78631e7ad
Author: Kevin Butler <haqkrs@xxxxxxxxx>
Date:   Mon Nov 4 02:36:32 2013 +0000

    Only download descriptor files from the last hour and a half.
---
 Makefile |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index cb2a3e0..bdf5bc1 100644
--- a/Makefile
+++ b/Makefile
@@ -41,9 +41,12 @@ data/cached-descriptors: descriptors
 	find data/descriptors -type f -mmin -60 | xargs cat > data/cached-descriptors
 	@echo "Done"
 
+descriptors_cutoff = $(shell date -u -v-1H -v-30M "+%Y/%m/%d %H:%M:%S")
 descriptors: data/descriptors/
+	@echo "Removing old descriptors"
+	@rm -r ./data/descriptors
 	@echo "Getting latest descriptors (This may take a while)"
-	@rsync -avz $(rsync_server)::$(descriptors_dir) --delete ./data/descriptors/
+	@rsync $(rsync_server)::$(descriptors_dir) | awk 'BEGIN { before="$(descriptors_cutoff)"; } before < ($$3 " " $$4) && ($$5!=".") {print $$5}' | rsync -avz --files-from=- $(rsync_server)::$(descriptors_dir) --delete ./data/descriptors/
 	@echo Done
 
 data/langs: data/



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits